aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-07-14 17:29:34 -0400
committerJonathan Corbet <corbet@lwn.net>2008-07-14 17:29:34 -0400
commit2fceef397f9880b212a74c418290ce69e7ac00eb (patch)
treed9cc09ab992825ef7fede4a688103503e3caf655 /drivers/usb
parentfeae1ef116ed381625d3731c5ae4f4ebcb3fa302 (diff)
parentbce7f793daec3e65ec5c5705d2457b81fe7b5725 (diff)
Merge commit 'v2.6.26' into bkl-removal
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/c67x00/c67x00-ll-hpi.c12
-rw-r--r--drivers/usb/class/Kconfig11
-rw-r--r--drivers/usb/class/Makefile1
-rw-r--r--drivers/usb/class/cdc-acm.c3
-rw-r--r--drivers/usb/class/cdc-wdm.c740
-rw-r--r--drivers/usb/core/generic.c5
-rw-r--r--drivers/usb/core/hcd.c53
-rw-r--r--drivers/usb/core/hcd.h4
-rw-r--r--drivers/usb/core/hub.c85
-rw-r--r--drivers/usb/core/quirks.c7
-rw-r--r--drivers/usb/core/sysfs.c44
-rw-r--r--drivers/usb/gadget/fsl_usb2_udc.c2
-rw-r--r--drivers/usb/gadget/pxa27x_udc.c3
-rw-r--r--drivers/usb/host/Kconfig8
-rw-r--r--drivers/usb/host/ehci-au1xxx.c1
-rw-r--r--drivers/usb/host/ehci-fsl.c7
-rw-r--r--drivers/usb/host/ehci-hub.c16
-rw-r--r--drivers/usb/host/ehci-ixp4xx.c4
-rw-r--r--drivers/usb/host/ehci-orion.c10
-rw-r--r--drivers/usb/host/ehci-pci.c4
-rw-r--r--drivers/usb/host/ehci-ppc-of.c2
-rw-r--r--drivers/usb/host/ehci-ppc-soc.c1
-rw-r--r--drivers/usb/host/ehci-ps3.c1
-rw-r--r--drivers/usb/host/ehci-sched.c67
-rw-r--r--drivers/usb/host/ehci.h24
-rw-r--r--drivers/usb/host/isp1760-hcd.c8
-rw-r--r--drivers/usb/host/isp1760-if.c4
-rw-r--r--drivers/usb/host/ohci-at91.c1
-rw-r--r--drivers/usb/host/ohci-au1xxx.c3
-rw-r--r--drivers/usb/host/ohci-ep93xx.c1
-rw-r--r--drivers/usb/host/ohci-hcd.c15
-rw-r--r--drivers/usb/host/ohci-hub.c53
-rw-r--r--drivers/usb/host/ohci-lh7a404.c3
-rw-r--r--drivers/usb/host/ohci-omap.c1
-rw-r--r--drivers/usb/host/ohci-pci.c1
-rw-r--r--drivers/usb/host/ohci-pnx4008.c1
-rw-r--r--drivers/usb/host/ohci-pnx8550.c1
-rw-r--r--drivers/usb/host/ohci-ppc-of.c1
-rw-r--r--drivers/usb/host/ohci-ppc-soc.c1
-rw-r--r--drivers/usb/host/ohci-ps3.c1
-rw-r--r--drivers/usb/host/ohci-pxa27x.c1
-rw-r--r--drivers/usb/host/ohci-q.c12
-rw-r--r--drivers/usb/host/ohci-s3c2410.c3
-rw-r--r--drivers/usb/host/ohci-sa1111.c3
-rw-r--r--drivers/usb/host/ohci-sh.c1
-rw-r--r--drivers/usb/host/ohci-sm501.c1
-rw-r--r--drivers/usb/host/ohci-ssb.c1
-rw-r--r--drivers/usb/host/u132-hcd.c11
-rw-r--r--drivers/usb/misc/Kconfig12
-rw-r--r--drivers/usb/misc/Makefile1
-rw-r--r--drivers/usb/misc/isight_firmware.c140
-rw-r--r--drivers/usb/misc/phidgetkit.c6
-rw-r--r--drivers/usb/misc/phidgetmotorcontrol.c7
-rw-r--r--drivers/usb/misc/phidgetservo.c6
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb.c2
-rw-r--r--drivers/usb/serial/ch341.c1
-rw-r--r--drivers/usb/serial/ftdi_sio.c266
-rw-r--r--drivers/usb/serial/ftdi_sio.h276
-rw-r--r--drivers/usb/serial/ipaq.c7
-rw-r--r--drivers/usb/serial/option.c42
-rw-r--r--drivers/usb/serial/pl2303.c3
-rw-r--r--drivers/usb/serial/pl2303.h3
-rw-r--r--drivers/usb/storage/unusual_devs.h18
63 files changed, 1830 insertions, 203 deletions
diff --git a/drivers/usb/c67x00/c67x00-ll-hpi.c b/drivers/usb/c67x00/c67x00-ll-hpi.c
index 5100fbbf6cb0..a9636f43bca2 100644
--- a/drivers/usb/c67x00/c67x00-ll-hpi.c
+++ b/drivers/usb/c67x00/c67x00-ll-hpi.c
@@ -120,7 +120,7 @@ static void hpi_write_word(struct c67x00_device *dev, u16 reg, u16 value)
120 * Only data is little endian, addr has cpu endianess 120 * Only data is little endian, addr has cpu endianess
121 */ 121 */
122static void hpi_write_words_le16(struct c67x00_device *dev, u16 addr, 122static void hpi_write_words_le16(struct c67x00_device *dev, u16 addr,
123 u16 *data, u16 count) 123 __le16 *data, u16 count)
124{ 124{
125 unsigned long flags; 125 unsigned long flags;
126 int i; 126 int i;
@@ -129,7 +129,7 @@ static void hpi_write_words_le16(struct c67x00_device *dev, u16 addr,
129 129
130 hpi_write_reg(dev, HPI_ADDR, addr); 130 hpi_write_reg(dev, HPI_ADDR, addr);
131 for (i = 0; i < count; i++) 131 for (i = 0; i < count; i++)
132 hpi_write_reg(dev, HPI_DATA, cpu_to_le16(*data++)); 132 hpi_write_reg(dev, HPI_DATA, le16_to_cpu(*data++));
133 133
134 spin_unlock_irqrestore(&dev->hpi.lock, flags); 134 spin_unlock_irqrestore(&dev->hpi.lock, flags);
135} 135}
@@ -138,7 +138,7 @@ static void hpi_write_words_le16(struct c67x00_device *dev, u16 addr,
138 * Only data is little endian, addr has cpu endianess 138 * Only data is little endian, addr has cpu endianess
139 */ 139 */
140static void hpi_read_words_le16(struct c67x00_device *dev, u16 addr, 140static void hpi_read_words_le16(struct c67x00_device *dev, u16 addr,
141 u16 *data, u16 count) 141 __le16 *data, u16 count)
142{ 142{
143 unsigned long flags; 143 unsigned long flags;
144 int i; 144 int i;
@@ -146,7 +146,7 @@ static void hpi_read_words_le16(struct c67x00_device *dev, u16 addr,
146 spin_lock_irqsave(&dev->hpi.lock, flags); 146 spin_lock_irqsave(&dev->hpi.lock, flags);
147 hpi_write_reg(dev, HPI_ADDR, addr); 147 hpi_write_reg(dev, HPI_ADDR, addr);
148 for (i = 0; i < count; i++) 148 for (i = 0; i < count; i++)
149 *data++ = le16_to_cpu(hpi_read_reg(dev, HPI_DATA)); 149 *data++ = cpu_to_le16(hpi_read_reg(dev, HPI_DATA));
150 150
151 spin_unlock_irqrestore(&dev->hpi.lock, flags); 151 spin_unlock_irqrestore(&dev->hpi.lock, flags);
152} 152}
@@ -425,7 +425,7 @@ void c67x00_ll_write_mem_le16(struct c67x00_device *dev, u16 addr,
425 len--; 425 len--;
426 } 426 }
427 427
428 hpi_write_words_le16(dev, addr, (u16 *)buf, len / 2); 428 hpi_write_words_le16(dev, addr, (__le16 *)buf, len / 2);
429 buf += len & ~0x01; 429 buf += len & ~0x01;
430 addr += len & ~0x01; 430 addr += len & ~0x01;
431 len &= 0x01; 431 len &= 0x01;
@@ -456,7 +456,7 @@ void c67x00_ll_read_mem_le16(struct c67x00_device *dev, u16 addr,
456 len--; 456 len--;
457 } 457 }
458 458
459 hpi_read_words_le16(dev, addr, (u16 *)buf, len / 2); 459 hpi_read_words_le16(dev, addr, (__le16 *)buf, len / 2);
460 buf += len & ~0x01; 460 buf += len & ~0x01;
461 addr += len & ~0x01; 461 addr += len & ~0x01;
462 len &= 0x01; 462 len &= 0x01;
diff --git a/drivers/usb/class/Kconfig b/drivers/usb/class/Kconfig
index 3a9102d2591b..66f17ed88cb5 100644
--- a/drivers/usb/class/Kconfig
+++ b/drivers/usb/class/Kconfig
@@ -29,3 +29,14 @@ config USB_PRINTER
29 To compile this driver as a module, choose M here: the 29 To compile this driver as a module, choose M here: the
30 module will be called usblp. 30 module will be called usblp.
31 31
32config USB_WDM
33 tristate "USB Wireless Device Management support"
34 depends on USB
35 ---help---
36 This driver supports the WMC Device Management functionality
37 of cell phones compliant to the CDC WMC specification. You can use
38 AT commands over this device.
39
40 To compile this driver as a module, choose M here: the
41 module will be called cdc-wdm.
42
diff --git a/drivers/usb/class/Makefile b/drivers/usb/class/Makefile
index cc391e6c2af8..535d59a30600 100644
--- a/drivers/usb/class/Makefile
+++ b/drivers/usb/class/Makefile
@@ -5,3 +5,4 @@
5 5
6obj-$(CONFIG_USB_ACM) += cdc-acm.o 6obj-$(CONFIG_USB_ACM) += cdc-acm.o
7obj-$(CONFIG_USB_PRINTER) += usblp.o 7obj-$(CONFIG_USB_PRINTER) += usblp.o
8obj-$(CONFIG_USB_WDM) += cdc-wdm.o
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 63c34043b4d9..c3201affa0b6 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1125,9 +1125,6 @@ static void stop_data_traffic(struct acm *acm)
1125 for (i = 0; i < acm->rx_buflimit; i++) 1125 for (i = 0; i < acm->rx_buflimit; i++)
1126 usb_kill_urb(acm->ru[i].urb); 1126 usb_kill_urb(acm->ru[i].urb);
1127 1127
1128 INIT_LIST_HEAD(&acm->filled_read_bufs);
1129 INIT_LIST_HEAD(&acm->spare_read_bufs);
1130
1131 tasklet_enable(&acm->urb_task); 1128 tasklet_enable(&acm->urb_task);
1132 1129
1133 cancel_work_sync(&acm->work); 1130 cancel_work_sync(&acm->work);
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
new file mode 100644
index 000000000000..731db051070a
--- /dev/null
+++ b/drivers/usb/class/cdc-wdm.c
@@ -0,0 +1,740 @@
1/*
2 * cdc-wdm.c
3 *
4 * This driver supports USB CDC WCM Device Management.
5 *
6 * Copyright (c) 2007-2008 Oliver Neukum
7 *
8 * Some code taken from cdc-acm.c
9 *
10 * Released under the GPLv2.
11 *
12 * Many thanks to Carl Nordbeck
13 */
14#include <linux/kernel.h>
15#include <linux/errno.h>
16#include <linux/slab.h>
17#include <linux/module.h>
18#include <linux/smp_lock.h>
19#include <linux/mutex.h>
20#include <linux/uaccess.h>
21#include <linux/bitops.h>
22#include <linux/poll.h>
23#include <linux/usb.h>
24#include <linux/usb/cdc.h>
25#include <asm/byteorder.h>
26#include <asm/unaligned.h>
27
28/*
29 * Version Information
30 */
31#define DRIVER_VERSION "v0.02"
32#define DRIVER_AUTHOR "Oliver Neukum"
33
34static struct usb_device_id wdm_ids[] = {
35 {
36 .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS |
37 USB_DEVICE_ID_MATCH_INT_SUBCLASS,
38 .bInterfaceClass = USB_CLASS_COMM,
39 .bInterfaceSubClass = USB_CDC_SUBCLASS_DMM
40 },
41 { }
42};
43
44#define WDM_MINOR_BASE 176
45
46
47#define WDM_IN_USE 1
48#define WDM_DISCONNECTING 2
49#define WDM_RESULT 3
50#define WDM_READ 4
51#define WDM_INT_STALL 5
52#define WDM_POLL_RUNNING 6
53
54
55#define WDM_MAX 16
56
57
58static DEFINE_MUTEX(wdm_mutex);
59
60/* --- method tables --- */
61
62struct wdm_device {
63 u8 *inbuf; /* buffer for response */
64 u8 *outbuf; /* buffer for command */
65 u8 *sbuf; /* buffer for status */
66 u8 *ubuf; /* buffer for copy to user space */
67
68 struct urb *command;
69 struct urb *response;
70 struct urb *validity;
71 struct usb_interface *intf;
72 struct usb_ctrlrequest *orq;
73 struct usb_ctrlrequest *irq;
74 spinlock_t iuspin;
75
76 unsigned long flags;
77 u16 bufsize;
78 u16 wMaxCommand;
79 u16 wMaxPacketSize;
80 u16 bMaxPacketSize0;
81 __le16 inum;
82 int reslength;
83 int length;
84 int read;
85 int count;
86 dma_addr_t shandle;
87 dma_addr_t ihandle;
88 struct mutex wlock;
89 struct mutex rlock;
90 wait_queue_head_t wait;
91 struct work_struct rxwork;
92 int werr;
93 int rerr;
94};
95
96static struct usb_driver wdm_driver;
97
98/* --- callbacks --- */
99static void wdm_out_callback(struct urb *urb)
100{
101 struct wdm_device *desc;
102 desc = urb->context;
103 spin_lock(&desc->iuspin);
104 desc->werr = urb->status;
105 spin_unlock(&desc->iuspin);
106 clear_bit(WDM_IN_USE, &desc->flags);
107 kfree(desc->outbuf);
108 wake_up(&desc->wait);
109}
110
111static void wdm_in_callback(struct urb *urb)
112{
113 struct wdm_device *desc = urb->context;
114 int status = urb->status;
115
116 spin_lock(&desc->iuspin);
117
118 if (status) {
119 switch (status) {
120 case -ENOENT:
121 dev_dbg(&desc->intf->dev,
122 "nonzero urb status received: -ENOENT");
123 break;
124 case -ECONNRESET:
125 dev_dbg(&desc->intf->dev,
126 "nonzero urb status received: -ECONNRESET");
127 break;
128 case -ESHUTDOWN:
129 dev_dbg(&desc->intf->dev,
130 "nonzero urb status received: -ESHUTDOWN");
131 break;
132 case -EPIPE:
133 err("nonzero urb status received: -EPIPE");
134 break;
135 default:
136 err("Unexpected error %d", status);
137 break;
138 }
139 }
140
141 desc->rerr = status;
142 desc->reslength = urb->actual_length;
143 memmove(desc->ubuf + desc->length, desc->inbuf, desc->reslength);
144 desc->length += desc->reslength;
145 wake_up(&desc->wait);
146
147 set_bit(WDM_READ, &desc->flags);
148 spin_unlock(&desc->iuspin);
149}
150
151static void wdm_int_callback(struct urb *urb)
152{
153 int rv = 0;
154 int status = urb->status;
155 struct wdm_device *desc;
156 struct usb_ctrlrequest *req;
157 struct usb_cdc_notification *dr;
158
159 desc = urb->context;
160 req = desc->irq;
161 dr = (struct usb_cdc_notification *)desc->sbuf;
162
163 if (status) {
164 switch (status) {
165 case -ESHUTDOWN:
166 case -ENOENT:
167 case -ECONNRESET:
168 return; /* unplug */
169 case -EPIPE:
170 set_bit(WDM_INT_STALL, &desc->flags);
171 err("Stall on int endpoint");
172 goto sw; /* halt is cleared in work */
173 default:
174 err("nonzero urb status received: %d", status);
175 break;
176 }
177 }
178
179 if (urb->actual_length < sizeof(struct usb_cdc_notification)) {
180 err("wdm_int_callback - %d bytes", urb->actual_length);
181 goto exit;
182 }
183
184 switch (dr->bNotificationType) {
185 case USB_CDC_NOTIFY_RESPONSE_AVAILABLE:
186 dev_dbg(&desc->intf->dev,
187 "NOTIFY_RESPONSE_AVAILABLE received: index %d len %d",
188 dr->wIndex, dr->wLength);
189 break;
190
191 case USB_CDC_NOTIFY_NETWORK_CONNECTION:
192
193 dev_dbg(&desc->intf->dev,
194 "NOTIFY_NETWORK_CONNECTION %s network",
195 dr->wValue ? "connected to" : "disconnected from");
196 goto exit;
197 default:
198 clear_bit(WDM_POLL_RUNNING, &desc->flags);
199 err("unknown notification %d received: index %d len %d",
200 dr->bNotificationType, dr->wIndex, dr->wLength);
201 goto exit;
202 }
203
204 req->bRequestType = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE);
205 req->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE;
206 req->wValue = 0;
207 req->wIndex = desc->inum;
208 req->wLength = cpu_to_le16(desc->bMaxPacketSize0);
209
210 usb_fill_control_urb(
211 desc->response,
212 interface_to_usbdev(desc->intf),
213 /* using common endpoint 0 */
214 usb_rcvctrlpipe(interface_to_usbdev(desc->intf), 0),
215 (unsigned char *)req,
216 desc->inbuf,
217 desc->bMaxPacketSize0,
218 wdm_in_callback,
219 desc
220 );
221 desc->response->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
222 spin_lock(&desc->iuspin);
223 clear_bit(WDM_READ, &desc->flags);
224 if (!test_bit(WDM_DISCONNECTING, &desc->flags)) {
225 rv = usb_submit_urb(desc->response, GFP_ATOMIC);
226 dev_dbg(&desc->intf->dev, "%s: usb_submit_urb %d",
227 __func__, rv);
228 }
229 spin_unlock(&desc->iuspin);
230 if (rv < 0) {
231 if (rv == -EPERM)
232 return;
233 if (rv == -ENOMEM) {
234sw:
235 rv = schedule_work(&desc->rxwork);
236 if (rv)
237 err("Cannot schedule work");
238 }
239 }
240exit:
241 rv = usb_submit_urb(urb, GFP_ATOMIC);
242 if (rv)
243 err("%s - usb_submit_urb failed with result %d",
244 __func__, rv);
245
246}
247
248static void kill_urbs(struct wdm_device *desc)
249{
250 usb_kill_urb(desc->command);
251 usb_kill_urb(desc->validity);
252 usb_kill_urb(desc->response);
253}
254
255static void free_urbs(struct wdm_device *desc)
256{
257 usb_free_urb(desc->validity);
258 usb_free_urb(desc->response);
259 usb_free_urb(desc->command);
260}
261
262static void cleanup(struct wdm_device *desc)
263{
264 usb_buffer_free(interface_to_usbdev(desc->intf),
265 desc->wMaxPacketSize,
266 desc->sbuf,
267 desc->validity->transfer_dma);
268 usb_buffer_free(interface_to_usbdev(desc->intf),
269 desc->wMaxPacketSize,
270 desc->inbuf,
271 desc->response->transfer_dma);
272 kfree(desc->orq);
273 kfree(desc->irq);
274 kfree(desc->ubuf);
275 free_urbs(desc);
276 kfree(desc);
277}
278
279static ssize_t wdm_write
280(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
281{
282 u8 *buf;
283 int rv = -EMSGSIZE, r, we;
284 struct wdm_device *desc = file->private_data;
285 struct usb_ctrlrequest *req;
286
287 if (count > desc->wMaxCommand)
288 count = desc->wMaxCommand;
289
290 spin_lock_irq(&desc->iuspin);
291 we = desc->werr;
292 desc->werr = 0;
293 spin_unlock_irq(&desc->iuspin);
294 if (we < 0)
295 return -EIO;
296
297 r = mutex_lock_interruptible(&desc->wlock); /* concurrent writes */
298 rv = -ERESTARTSYS;
299 if (r)
300 goto outnl;
301
302 r = wait_event_interruptible(desc->wait, !test_bit(WDM_IN_USE,
303 &desc->flags));
304 if (r < 0)
305 goto out;
306
307 if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
308 rv = -ENODEV;
309 goto out;
310 }
311
312 desc->outbuf = buf = kmalloc(count, GFP_KERNEL);
313 if (!buf) {
314 rv = -ENOMEM;
315 goto out;
316 }
317
318 r = copy_from_user(buf, buffer, count);
319 if (r > 0) {
320 kfree(buf);
321 rv = -EFAULT;
322 goto out;
323 }
324
325 req = desc->orq;
326 usb_fill_control_urb(
327 desc->command,
328 interface_to_usbdev(desc->intf),
329 /* using common endpoint 0 */
330 usb_sndctrlpipe(interface_to_usbdev(desc->intf), 0),
331 (unsigned char *)req,
332 buf,
333 count,
334 wdm_out_callback,
335 desc
336 );
337
338 req->bRequestType = (USB_DIR_OUT | USB_TYPE_CLASS |
339 USB_RECIP_INTERFACE);
340 req->bRequest = USB_CDC_SEND_ENCAPSULATED_COMMAND;
341 req->wValue = 0;
342 req->wIndex = desc->inum;
343 req->wLength = cpu_to_le16(count);
344 set_bit(WDM_IN_USE, &desc->flags);
345
346 rv = usb_submit_urb(desc->command, GFP_KERNEL);
347 if (rv < 0) {
348 kfree(buf);
349 clear_bit(WDM_IN_USE, &desc->flags);
350 } else {
351 dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d",
352 req->wIndex);
353 }
354out:
355 mutex_unlock(&desc->wlock);
356outnl:
357 return rv < 0 ? rv : count;
358}
359
360static ssize_t wdm_read
361(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
362{
363 int rv, cntr;
364 int i = 0;
365 struct wdm_device *desc = file->private_data;
366
367
368 rv = mutex_lock_interruptible(&desc->rlock); /*concurrent reads */
369 if (rv < 0)
370 return -ERESTARTSYS;
371
372 if (desc->length == 0) {
373 desc->read = 0;
374retry:
375 i++;
376 rv = wait_event_interruptible(desc->wait,
377 test_bit(WDM_READ, &desc->flags));
378
379 if (rv < 0) {
380 rv = -ERESTARTSYS;
381 goto err;
382 }
383
384 spin_lock_irq(&desc->iuspin);
385
386 if (desc->rerr) { /* read completed, error happened */
387 int t = desc->rerr;
388 desc->rerr = 0;
389 spin_unlock_irq(&desc->iuspin);
390 err("reading had resulted in %d", t);
391 rv = -EIO;
392 goto err;
393 }
394 /*
395 * recheck whether we've lost the race
396 * against the completion handler
397 */
398 if (!test_bit(WDM_READ, &desc->flags)) { /* lost race */
399 spin_unlock_irq(&desc->iuspin);
400 goto retry;
401 }
402 if (!desc->reslength) { /* zero length read */
403 spin_unlock_irq(&desc->iuspin);
404 goto retry;
405 }
406 clear_bit(WDM_READ, &desc->flags);
407 spin_unlock_irq(&desc->iuspin);
408 }
409
410 cntr = count > desc->length ? desc->length : count;
411 rv = copy_to_user(buffer, desc->ubuf, cntr);
412 if (rv > 0) {
413 rv = -EFAULT;
414 goto err;
415 }
416
417 for (i = 0; i < desc->length - cntr; i++)
418 desc->ubuf[i] = desc->ubuf[i + cntr];
419
420 desc->length -= cntr;
421 rv = cntr;
422
423err:
424 mutex_unlock(&desc->rlock);
425 if (rv < 0)
426 err("wdm_read: exit error");
427 return rv;
428}
429
430static int wdm_flush(struct file *file, fl_owner_t id)
431{
432 struct wdm_device *desc = file->private_data;
433
434 wait_event(desc->wait, !test_bit(WDM_IN_USE, &desc->flags));
435 if (desc->werr < 0)
436 err("Error in flush path: %d", desc->werr);
437
438 return desc->werr;
439}
440
441static unsigned int wdm_poll(struct file *file, struct poll_table_struct *wait)
442{
443 struct wdm_device *desc = file->private_data;
444 unsigned long flags;
445 unsigned int mask = 0;
446
447 spin_lock_irqsave(&desc->iuspin, flags);
448 if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
449 mask = POLLERR;
450 spin_unlock_irqrestore(&desc->iuspin, flags);
451 goto desc_out;
452 }
453 if (test_bit(WDM_READ, &desc->flags))
454 mask = POLLIN | POLLRDNORM;
455 if (desc->rerr || desc->werr)
456 mask |= POLLERR;
457 if (!test_bit(WDM_IN_USE, &desc->flags))
458 mask |= POLLOUT | POLLWRNORM;
459 spin_unlock_irqrestore(&desc->iuspin, flags);
460
461 poll_wait(file, &desc->wait, wait);
462
463desc_out:
464 return mask;
465}
466
467static int wdm_open(struct inode *inode, struct file *file)
468{
469 int minor = iminor(inode);
470 int rv = -ENODEV;
471 struct usb_interface *intf;
472 struct wdm_device *desc;
473
474 mutex_lock(&wdm_mutex);
475 intf = usb_find_interface(&wdm_driver, minor);
476 if (!intf)
477 goto out;
478
479 desc = usb_get_intfdata(intf);
480 if (test_bit(WDM_DISCONNECTING, &desc->flags))
481 goto out;
482
483 desc->count++;
484 file->private_data = desc;
485
486 rv = usb_submit_urb(desc->validity, GFP_KERNEL);
487
488 if (rv < 0) {
489 desc->count--;
490 err("Error submitting int urb - %d", rv);
491 goto out;
492 }
493 rv = 0;
494
495out:
496 mutex_unlock(&wdm_mutex);
497 return rv;
498}
499
500static int wdm_release(struct inode *inode, struct file *file)
501{
502 struct wdm_device *desc = file->private_data;
503
504 mutex_lock(&wdm_mutex);
505 desc->count--;
506 if (!desc->count) {
507 dev_dbg(&desc->intf->dev, "wdm_release: cleanup");
508 kill_urbs(desc);
509 }
510 mutex_unlock(&wdm_mutex);
511 return 0;
512}
513
514static const struct file_operations wdm_fops = {
515 .owner = THIS_MODULE,
516 .read = wdm_read,
517 .write = wdm_write,
518 .open = wdm_open,
519 .flush = wdm_flush,
520 .release = wdm_release,
521 .poll = wdm_poll
522};
523
524static struct usb_class_driver wdm_class = {
525 .name = "cdc-wdm%d",
526 .fops = &wdm_fops,
527 .minor_base = WDM_MINOR_BASE,
528};
529
530/* --- error handling --- */
531static void wdm_rxwork(struct work_struct *work)
532{
533 struct wdm_device *desc = container_of(work, struct wdm_device, rxwork);
534 unsigned long flags;
535 int rv;
536
537 spin_lock_irqsave(&desc->iuspin, flags);
538 if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
539 spin_unlock_irqrestore(&desc->iuspin, flags);
540 } else {
541 spin_unlock_irqrestore(&desc->iuspin, flags);
542 rv = usb_submit_urb(desc->response, GFP_KERNEL);
543 if (rv < 0 && rv != -EPERM) {
544 spin_lock_irqsave(&desc->iuspin, flags);
545 if (!test_bit(WDM_DISCONNECTING, &desc->flags))
546 schedule_work(&desc->rxwork);
547 spin_unlock_irqrestore(&desc->iuspin, flags);
548 }
549 }
550}
551
552/* --- hotplug --- */
553
554static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
555{
556 int rv = -EINVAL;
557 struct usb_device *udev = interface_to_usbdev(intf);
558 struct wdm_device *desc;
559 struct usb_host_interface *iface;
560 struct usb_endpoint_descriptor *ep;
561 struct usb_cdc_dmm_desc *dmhd;
562 u8 *buffer = intf->altsetting->extra;
563 int buflen = intf->altsetting->extralen;
564 u16 maxcom = 0;
565
566 if (!buffer)
567 goto out;
568
569 while (buflen > 0) {
570 if (buffer [1] != USB_DT_CS_INTERFACE) {
571 err("skipping garbage");
572 goto next_desc;
573 }
574
575 switch (buffer [2]) {
576 case USB_CDC_HEADER_TYPE:
577 break;
578 case USB_CDC_DMM_TYPE:
579 dmhd = (struct usb_cdc_dmm_desc *)buffer;
580 maxcom = le16_to_cpu(dmhd->wMaxCommand);
581 dev_dbg(&intf->dev,
582 "Finding maximum buffer length: %d", maxcom);
583 break;
584 default:
585 err("Ignoring extra header, type %d, length %d",
586 buffer[2], buffer[0]);
587 break;
588 }
589next_desc:
590 buflen -= buffer[0];
591 buffer += buffer[0];
592 }
593
594 rv = -ENOMEM;
595 desc = kzalloc(sizeof(struct wdm_device), GFP_KERNEL);
596 if (!desc)
597 goto out;
598 mutex_init(&desc->wlock);
599 mutex_init(&desc->rlock);
600 spin_lock_init(&desc->iuspin);
601 init_waitqueue_head(&desc->wait);
602 desc->wMaxCommand = maxcom;
603 desc->inum = cpu_to_le16((u16)intf->cur_altsetting->desc.bInterfaceNumber);
604 desc->intf = intf;
605 INIT_WORK(&desc->rxwork, wdm_rxwork);
606
607 iface = &intf->altsetting[0];
608 ep = &iface->endpoint[0].desc;
609 if (!usb_endpoint_is_int_in(ep)) {
610 rv = -EINVAL;
611 goto err;
612 }
613
614 desc->wMaxPacketSize = le16_to_cpu(ep->wMaxPacketSize);
615 desc->bMaxPacketSize0 = udev->descriptor.bMaxPacketSize0;
616
617 desc->orq = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL);
618 if (!desc->orq)
619 goto err;
620 desc->irq = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL);
621 if (!desc->irq)
622 goto err;
623
624 desc->validity = usb_alloc_urb(0, GFP_KERNEL);
625 if (!desc->validity)
626 goto err;
627
628 desc->response = usb_alloc_urb(0, GFP_KERNEL);
629 if (!desc->response)
630 goto err;
631
632 desc->command = usb_alloc_urb(0, GFP_KERNEL);
633 if (!desc->command)
634 goto err;
635
636 desc->ubuf = kmalloc(desc->wMaxCommand, GFP_KERNEL);
637 if (!desc->ubuf)
638 goto err;
639
640 desc->sbuf = usb_buffer_alloc(interface_to_usbdev(intf),
641 desc->wMaxPacketSize,
642 GFP_KERNEL,
643 &desc->validity->transfer_dma);
644 if (!desc->sbuf)
645 goto err;
646
647 desc->inbuf = usb_buffer_alloc(interface_to_usbdev(intf),
648 desc->bMaxPacketSize0,
649 GFP_KERNEL,
650 &desc->response->transfer_dma);
651 if (!desc->inbuf)
652 goto err2;
653
654 usb_fill_int_urb(
655 desc->validity,
656 interface_to_usbdev(intf),
657 usb_rcvintpipe(interface_to_usbdev(intf), ep->bEndpointAddress),
658 desc->sbuf,
659 desc->wMaxPacketSize,
660 wdm_int_callback,
661 desc,
662 ep->bInterval
663 );
664 desc->validity->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
665
666 usb_set_intfdata(intf, desc);
667 rv = usb_register_dev(intf, &wdm_class);
668 dev_info(&intf->dev, "cdc-wdm%d: USB WDM device\n",
669 intf->minor - WDM_MINOR_BASE);
670 if (rv < 0)
671 goto err;
672out:
673 return rv;
674err2:
675 usb_buffer_free(interface_to_usbdev(desc->intf),
676 desc->wMaxPacketSize,
677 desc->sbuf,
678 desc->validity->transfer_dma);
679err:
680 free_urbs(desc);
681 kfree(desc->ubuf);
682 kfree(desc->orq);
683 kfree(desc->irq);
684 kfree(desc);
685 return rv;
686}
687
688static void wdm_disconnect(struct usb_interface *intf)
689{
690 struct wdm_device *desc;
691 unsigned long flags;
692
693 usb_deregister_dev(intf, &wdm_class);
694 mutex_lock(&wdm_mutex);
695 desc = usb_get_intfdata(intf);
696
697 /* the spinlock makes sure no new urbs are generated in the callbacks */
698 spin_lock_irqsave(&desc->iuspin, flags);
699 set_bit(WDM_DISCONNECTING, &desc->flags);
700 set_bit(WDM_READ, &desc->flags);
701 clear_bit(WDM_IN_USE, &desc->flags);
702 spin_unlock_irqrestore(&desc->iuspin, flags);
703 cancel_work_sync(&desc->rxwork);
704 kill_urbs(desc);
705 wake_up_all(&desc->wait);
706 if (!desc->count)
707 cleanup(desc);
708 mutex_unlock(&wdm_mutex);
709}
710
711static struct usb_driver wdm_driver = {
712 .name = "cdc_wdm",
713 .probe = wdm_probe,
714 .disconnect = wdm_disconnect,
715 .id_table = wdm_ids,
716};
717
718/* --- low level module stuff --- */
719
720static int __init wdm_init(void)
721{
722 int rv;
723
724 rv = usb_register(&wdm_driver);
725
726 return rv;
727}
728
729static void __exit wdm_exit(void)
730{
731 usb_deregister(&wdm_driver);
732}
733
734module_init(wdm_init);
735module_exit(wdm_exit);
736
737MODULE_AUTHOR(DRIVER_AUTHOR);
738MODULE_DESCRIPTION("USB Abstract Control Model driver for "
739 "USB WCM Device Management");
740MODULE_LICENSE("GPL");
diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
index c1cb94e9f242..7e912f21fd36 100644
--- a/drivers/usb/core/generic.c
+++ b/drivers/usb/core/generic.c
@@ -155,9 +155,6 @@ static int generic_probe(struct usb_device *udev)
155{ 155{
156 int err, c; 156 int err, c;
157 157
158 /* put device-specific files into sysfs */
159 usb_create_sysfs_dev_files(udev);
160
161 /* Choose and set the configuration. This registers the interfaces 158 /* Choose and set the configuration. This registers the interfaces
162 * with the driver core and lets interface drivers bind to them. 159 * with the driver core and lets interface drivers bind to them.
163 */ 160 */
@@ -189,8 +186,6 @@ static void generic_disconnect(struct usb_device *udev)
189 * unconfigure the device */ 186 * unconfigure the device */
190 if (udev->actconfig) 187 if (udev->actconfig)
191 usb_set_configuration(udev, -1); 188 usb_set_configuration(udev, -1);
192
193 usb_remove_sysfs_dev_files(udev);
194} 189}
195 190
196#ifdef CONFIG_PM 191#ifdef CONFIG_PM
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index bf10e9c4195e..42a436478b78 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -818,12 +818,12 @@ static int usb_register_bus(struct usb_bus *bus)
818 set_bit (busnum, busmap.busmap); 818 set_bit (busnum, busmap.busmap);
819 bus->busnum = busnum; 819 bus->busnum = busnum;
820 820
821 bus->dev = device_create(usb_host_class, bus->controller, MKDEV(0, 0), 821 bus->dev = device_create_drvdata(usb_host_class, bus->controller,
822 "usb_host%d", busnum); 822 MKDEV(0, 0), bus,
823 "usb_host%d", busnum);
823 result = PTR_ERR(bus->dev); 824 result = PTR_ERR(bus->dev);
824 if (IS_ERR(bus->dev)) 825 if (IS_ERR(bus->dev))
825 goto error_create_class_dev; 826 goto error_create_class_dev;
826 dev_set_drvdata(bus->dev, bus);
827 827
828 /* Add it to the local list of buses */ 828 /* Add it to the local list of buses */
829 list_add (&bus->bus_list, &usb_bus_list); 829 list_add (&bus->bus_list, &usb_bus_list);
@@ -924,6 +924,15 @@ static int register_root_hub(struct usb_hcd *hcd)
924 return retval; 924 return retval;
925} 925}
926 926
927void usb_enable_root_hub_irq (struct usb_bus *bus)
928{
929 struct usb_hcd *hcd;
930
931 hcd = container_of (bus, struct usb_hcd, self);
932 if (hcd->driver->hub_irq_enable && hcd->state != HC_STATE_HALT)
933 hcd->driver->hub_irq_enable (hcd);
934}
935
927 936
928/*-------------------------------------------------------------------------*/ 937/*-------------------------------------------------------------------------*/
929 938
@@ -1684,19 +1693,30 @@ EXPORT_SYMBOL_GPL(usb_bus_start_enum);
1684irqreturn_t usb_hcd_irq (int irq, void *__hcd) 1693irqreturn_t usb_hcd_irq (int irq, void *__hcd)
1685{ 1694{
1686 struct usb_hcd *hcd = __hcd; 1695 struct usb_hcd *hcd = __hcd;
1687 int start = hcd->state; 1696 unsigned long flags;
1697 irqreturn_t rc;
1688 1698
1689 if (unlikely(start == HC_STATE_HALT || 1699 /* IRQF_DISABLED doesn't work correctly with shared IRQs
1690 !test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) 1700 * when the first handler doesn't use it. So let's just
1691 return IRQ_NONE; 1701 * assume it's never used.
1692 if (hcd->driver->irq (hcd) == IRQ_NONE) 1702 */
1693 return IRQ_NONE; 1703 local_irq_save(flags);
1694 1704
1695 set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags); 1705 if (unlikely(hcd->state == HC_STATE_HALT ||
1706 !test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) {
1707 rc = IRQ_NONE;
1708 } else if (hcd->driver->irq(hcd) == IRQ_NONE) {
1709 rc = IRQ_NONE;
1710 } else {
1711 set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
1712
1713 if (unlikely(hcd->state == HC_STATE_HALT))
1714 usb_hc_died(hcd);
1715 rc = IRQ_HANDLED;
1716 }
1696 1717
1697 if (unlikely(hcd->state == HC_STATE_HALT)) 1718 local_irq_restore(flags);
1698 usb_hc_died (hcd); 1719 return rc;
1699 return IRQ_HANDLED;
1700} 1720}
1701 1721
1702/*-------------------------------------------------------------------------*/ 1722/*-------------------------------------------------------------------------*/
@@ -1860,6 +1880,13 @@ int usb_add_hcd(struct usb_hcd *hcd,
1860 1880
1861 /* enable irqs just before we start the controller */ 1881 /* enable irqs just before we start the controller */
1862 if (hcd->driver->irq) { 1882 if (hcd->driver->irq) {
1883
1884 /* IRQF_DISABLED doesn't work as advertised when used together
1885 * with IRQF_SHARED. As usb_hcd_irq() will always disable
1886 * interrupts we can remove it here.
1887 */
1888 irqflags &= ~IRQF_DISABLED;
1889
1863 snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d", 1890 snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d",
1864 hcd->driver->description, hcd->self.busnum); 1891 hcd->driver->description, hcd->self.busnum);
1865 if ((retval = request_irq(irqnum, &usb_hcd_irq, irqflags, 1892 if ((retval = request_irq(irqnum, &usb_hcd_irq, irqflags,
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
index 1e4b81e9eb50..b9de1569b39e 100644
--- a/drivers/usb/core/hcd.h
+++ b/drivers/usb/core/hcd.h
@@ -210,9 +210,13 @@ struct hc_driver {
210 int (*bus_suspend)(struct usb_hcd *); 210 int (*bus_suspend)(struct usb_hcd *);
211 int (*bus_resume)(struct usb_hcd *); 211 int (*bus_resume)(struct usb_hcd *);
212 int (*start_port_reset)(struct usb_hcd *, unsigned port_num); 212 int (*start_port_reset)(struct usb_hcd *, unsigned port_num);
213 void (*hub_irq_enable)(struct usb_hcd *);
214 /* Needed only if port-change IRQs are level-triggered */
213 215
214 /* force handover of high-speed port to full-speed companion */ 216 /* force handover of high-speed port to full-speed companion */
215 void (*relinquish_port)(struct usb_hcd *, int); 217 void (*relinquish_port)(struct usb_hcd *, int);
218 /* has a port been handed over to a companion? */
219 int (*port_handed_over)(struct usb_hcd *, int);
216}; 220};
217 221
218extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); 222extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index eb57fcc701d7..4cfe32a16c37 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -644,6 +644,48 @@ static void hub_stop(struct usb_hub *hub)
644 644
645#ifdef CONFIG_PM 645#ifdef CONFIG_PM
646 646
647/* Try to identify which devices need USB-PERSIST handling */
648static int persistent_device(struct usb_device *udev)
649{
650 int i;
651 int retval;
652 struct usb_host_config *actconfig;
653
654 /* Explicitly not marked persistent? */
655 if (!udev->persist_enabled)
656 return 0;
657
658 /* No active config? */
659 actconfig = udev->actconfig;
660 if (!actconfig)
661 return 0;
662
663 /* FIXME! We should check whether it's open here or not! */
664
665 /*
666 * Check that all the interface drivers have a
667 * 'reset_resume' entrypoint
668 */
669 retval = 0;
670 for (i = 0; i < actconfig->desc.bNumInterfaces; i++) {
671 struct usb_interface *intf;
672 struct usb_driver *driver;
673
674 intf = actconfig->interface[i];
675 if (!intf->dev.driver)
676 continue;
677 driver = to_usb_driver(intf->dev.driver);
678 if (!driver->reset_resume)
679 return 0;
680 /*
681 * We have at least one driver, and that one
682 * has a reset_resume method.
683 */
684 retval = 1;
685 }
686 return retval;
687}
688
647static void hub_restart(struct usb_hub *hub, int type) 689static void hub_restart(struct usb_hub *hub, int type)
648{ 690{
649 struct usb_device *hdev = hub->hdev; 691 struct usb_device *hdev = hub->hdev;
@@ -671,26 +713,19 @@ static void hub_restart(struct usb_hub *hub, int type)
671 } 713 }
672 714
673 /* Was the power session lost while we were suspended? */ 715 /* Was the power session lost while we were suspended? */
674 switch (type) { 716 status = hub_port_status(hub, port1, &portstatus, &portchange);
675 case HUB_RESET_RESUME:
676 portstatus = 0;
677 portchange = USB_PORT_STAT_C_CONNECTION;
678 break;
679 717
680 case HUB_RESET: 718 /* If the device is gone, khubd will handle it later */
681 case HUB_RESUME: 719 if (status == 0 && !(portstatus & USB_PORT_STAT_CONNECTION))
682 status = hub_port_status(hub, port1, 720 continue;
683 &portstatus, &portchange);
684 break;
685 }
686 721
687 /* For "USB_PERSIST"-enabled children we must 722 /* For "USB_PERSIST"-enabled children we must
688 * mark the child device for reset-resume and 723 * mark the child device for reset-resume and
689 * turn off the various status changes to prevent 724 * turn off the various status changes to prevent
690 * khubd from disconnecting it later. 725 * khubd from disconnecting it later.
691 */ 726 */
692 if (udev->persist_enabled && status == 0 && 727 if (status == 0 && !(portstatus & USB_PORT_STAT_ENABLE) &&
693 !(portstatus & USB_PORT_STAT_ENABLE)) { 728 persistent_device(udev)) {
694 if (portchange & USB_PORT_STAT_C_ENABLE) 729 if (portchange & USB_PORT_STAT_C_ENABLE)
695 clear_port_feature(hub->hdev, port1, 730 clear_port_feature(hub->hdev, port1,
696 USB_PORT_FEAT_C_ENABLE); 731 USB_PORT_FEAT_C_ENABLE);
@@ -1326,6 +1361,12 @@ void usb_disconnect(struct usb_device **pdev)
1326 1361
1327 usb_unlock_device(udev); 1362 usb_unlock_device(udev);
1328 1363
1364 /* Remove the device-specific files from sysfs. This must be
1365 * done with udev unlocked, because some of the attribute
1366 * routines try to acquire the device lock.
1367 */
1368 usb_remove_sysfs_dev_files(udev);
1369
1329 /* Unregister the device. The device driver is responsible 1370 /* Unregister the device. The device driver is responsible
1330 * for removing the device files from usbfs and sysfs and for 1371 * for removing the device files from usbfs and sysfs and for
1331 * de-configuring the device. 1372 * de-configuring the device.
@@ -1541,6 +1582,9 @@ int usb_new_device(struct usb_device *udev)
1541 goto fail; 1582 goto fail;
1542 } 1583 }
1543 1584
1585 /* put device-specific files into sysfs */
1586 usb_create_sysfs_dev_files(udev);
1587
1544 /* Tell the world! */ 1588 /* Tell the world! */
1545 announce_device(udev); 1589 announce_device(udev);
1546 return err; 1590 return err;
@@ -2029,6 +2073,8 @@ int usb_port_resume(struct usb_device *udev)
2029 } 2073 }
2030 2074
2031 clear_bit(port1, hub->busy_bits); 2075 clear_bit(port1, hub->busy_bits);
2076 if (!hub->hdev->parent && !hub->busy_bits[0])
2077 usb_enable_root_hub_irq(hub->hdev->bus);
2032 2078
2033 if (status == 0) 2079 if (status == 0)
2034 status = finish_port_resume(udev); 2080 status = finish_port_resume(udev);
@@ -2744,7 +2790,11 @@ loop:
2744 if ((status == -ENOTCONN) || (status == -ENOTSUPP)) 2790 if ((status == -ENOTCONN) || (status == -ENOTSUPP))
2745 break; 2791 break;
2746 } 2792 }
2747 dev_err(hub_dev, "unable to enumerate USB device on port %d\n", port1); 2793 if (hub->hdev->parent ||
2794 !hcd->driver->port_handed_over ||
2795 !(hcd->driver->port_handed_over)(hcd, port1))
2796 dev_err(hub_dev, "unable to enumerate USB device on port %d\n",
2797 port1);
2748 2798
2749done: 2799done:
2750 hub_port_disable(hub, port1, 1); 2800 hub_port_disable(hub, port1, 1);
@@ -2954,6 +3004,11 @@ static void hub_events(void)
2954 3004
2955 hub->activating = 0; 3005 hub->activating = 0;
2956 3006
3007 /* If this is a root hub, tell the HCD it's okay to
3008 * re-enable port-change interrupts now. */
3009 if (!hdev->parent && !hub->busy_bits[0])
3010 usb_enable_root_hub_irq(hdev->bus);
3011
2957loop_autopm: 3012loop_autopm:
2958 /* Allow autosuspend if we're not going to run again */ 3013 /* Allow autosuspend if we're not going to run again */
2959 if (list_empty(&hub->event_list)) 3014 if (list_empty(&hub->event_list))
@@ -3179,6 +3234,8 @@ int usb_reset_device(struct usb_device *udev)
3179 break; 3234 break;
3180 } 3235 }
3181 clear_bit(port1, parent_hub->busy_bits); 3236 clear_bit(port1, parent_hub->busy_bits);
3237 if (!parent_hdev->parent && !parent_hub->busy_bits[0])
3238 usb_enable_root_hub_irq(parent_hdev->bus);
3182 3239
3183 if (ret < 0) 3240 if (ret < 0)
3184 goto re_enumerate; 3241 goto re_enumerate;
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 2e2019390290..c070b34b669d 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -47,6 +47,13 @@ static const struct usb_device_id usb_quirk_list[] = {
47 /* Edirol SD-20 */ 47 /* Edirol SD-20 */
48 { USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME }, 48 { USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME },
49 49
50 /* appletouch */
51 { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME },
52
53 /* Avision AV600U */
54 { USB_DEVICE(0x0638, 0x0a13), .driver_info =
55 USB_QUIRK_STRING_FETCH_255 },
56
50 /* M-Systems Flash Disk Pioneers */ 57 /* M-Systems Flash Disk Pioneers */
51 { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME }, 58 { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
52 59
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index c783cb111847..5e1f5d55bf04 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -588,35 +588,33 @@ read_descriptors(struct kobject *kobj, struct bin_attribute *attr,
588 container_of(kobj, struct device, kobj)); 588 container_of(kobj, struct device, kobj));
589 size_t nleft = count; 589 size_t nleft = count;
590 size_t srclen, n; 590 size_t srclen, n;
591 int cfgno;
592 void *src;
591 593
592 usb_lock_device(udev); 594 /* The binary attribute begins with the device descriptor.
593 595 * Following that are the raw descriptor entries for all the
594 /* The binary attribute begins with the device descriptor */ 596 * configurations (config plus subsidiary descriptors).
595 srclen = sizeof(struct usb_device_descriptor);
596 if (off < srclen) {
597 n = min_t(size_t, nleft, srclen - off);
598 memcpy(buf, off + (char *) &udev->descriptor, n);
599 nleft -= n;
600 buf += n;
601 off = 0;
602 } else {
603 off -= srclen;
604 }
605
606 /* Then follows the raw descriptor entry for the current
607 * configuration (config plus subsidiary descriptors).
608 */ 597 */
609 if (udev->actconfig) { 598 for (cfgno = -1; cfgno < udev->descriptor.bNumConfigurations &&
610 int cfgno = udev->actconfig - udev->config; 599 nleft > 0; ++cfgno) {
611 600 if (cfgno < 0) {
612 srclen = __le16_to_cpu(udev->actconfig->desc.wTotalLength); 601 src = &udev->descriptor;
602 srclen = sizeof(struct usb_device_descriptor);
603 } else {
604 src = udev->rawdescriptors[cfgno];
605 srclen = __le16_to_cpu(udev->config[cfgno].desc.
606 wTotalLength);
607 }
613 if (off < srclen) { 608 if (off < srclen) {
614 n = min_t(size_t, nleft, srclen - off); 609 n = min(nleft, srclen - (size_t) off);
615 memcpy(buf, off + udev->rawdescriptors[cfgno], n); 610 memcpy(buf, src + off, n);
616 nleft -= n; 611 nleft -= n;
612 buf += n;
613 off = 0;
614 } else {
615 off -= srclen;
617 } 616 }
618 } 617 }
619 usb_unlock_device(udev);
620 return count - nleft; 618 return count - nleft;
621} 619}
622 620
diff --git a/drivers/usb/gadget/fsl_usb2_udc.c b/drivers/usb/gadget/fsl_usb2_udc.c
index 651b82701394..18687543d7fa 100644
--- a/drivers/usb/gadget/fsl_usb2_udc.c
+++ b/drivers/usb/gadget/fsl_usb2_udc.c
@@ -1627,7 +1627,9 @@ static int reset_queues(struct fsl_udc *udc)
1627 udc_reset_ep_queue(udc, pipe); 1627 udc_reset_ep_queue(udc, pipe);
1628 1628
1629 /* report disconnect; the driver is already quiesced */ 1629 /* report disconnect; the driver is already quiesced */
1630 spin_unlock(&udc->lock);
1630 udc->driver->disconnect(&udc->gadget); 1631 udc->driver->disconnect(&udc->gadget);
1632 spin_lock(&udc->lock);
1631 1633
1632 return 0; 1634 return 0;
1633} 1635}
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
index 499b7a23f351..e02bfd4df3a6 100644
--- a/drivers/usb/gadget/pxa27x_udc.c
+++ b/drivers/usb/gadget/pxa27x_udc.c
@@ -1526,7 +1526,8 @@ static void udc_disable(struct pxa_udc *udc)
1526 1526
1527 ep0_idle(udc); 1527 ep0_idle(udc);
1528 udc->gadget.speed = USB_SPEED_UNKNOWN; 1528 udc->gadget.speed = USB_SPEED_UNKNOWN;
1529 udc->mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT); 1529 if (udc->mach->udc_command)
1530 udc->mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
1530} 1531}
1531 1532
1532/** 1533/**
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 1ef6df395e0c..228797e54f9c 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -300,8 +300,8 @@ config USB_R8A66597_HCD
300 module will be called r8a66597-hcd. 300 module will be called r8a66597-hcd.
301 301
302config SUPERH_ON_CHIP_R8A66597 302config SUPERH_ON_CHIP_R8A66597
303 boolean "Enable SuperH on-chip USB like the R8A66597" 303 boolean "Enable SuperH on-chip R8A66597 USB"
304 depends on USB_R8A66597_HCD && CPU_SUBTYPE_SH7366 304 depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723)
305 help 305 help
306 Renesas SuperH processor has USB like the R8A66597. 306 This driver enables support for the on-chip R8A66597 in the
307 This driver supported processor is SH7366. 307 SH7366 and SH7723 processors.
diff --git a/drivers/usb/host/ehci-au1xxx.c b/drivers/usb/host/ehci-au1xxx.c
index 8b5f991e949c..08a4335401a9 100644
--- a/drivers/usb/host/ehci-au1xxx.c
+++ b/drivers/usb/host/ehci-au1xxx.c
@@ -223,6 +223,7 @@ static const struct hc_driver ehci_au1xxx_hc_driver = {
223 .bus_suspend = ehci_bus_suspend, 223 .bus_suspend = ehci_bus_suspend,
224 .bus_resume = ehci_bus_resume, 224 .bus_resume = ehci_bus_resume,
225 .relinquish_port = ehci_relinquish_port, 225 .relinquish_port = ehci_relinquish_port,
226 .port_handed_over = ehci_port_handed_over,
226}; 227};
227 228
228/*-------------------------------------------------------------------------*/ 229/*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 6d9bed6c1f48..7370d6187c64 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -269,7 +269,7 @@ static int ehci_fsl_setup(struct usb_hcd *hcd)
269 if (retval) 269 if (retval)
270 return retval; 270 return retval;
271 271
272 ehci->is_tdi_rh_tt = 1; 272 hcd->has_tt = 1;
273 273
274 ehci->sbrn = 0x20; 274 ehci->sbrn = 0x20;
275 275
@@ -295,10 +295,6 @@ static const struct hc_driver ehci_fsl_hc_driver = {
295 */ 295 */
296 .reset = ehci_fsl_setup, 296 .reset = ehci_fsl_setup,
297 .start = ehci_run, 297 .start = ehci_run,
298#ifdef CONFIG_PM
299 .suspend = ehci_bus_suspend,
300 .resume = ehci_bus_resume,
301#endif
302 .stop = ehci_stop, 298 .stop = ehci_stop,
303 .shutdown = ehci_shutdown, 299 .shutdown = ehci_shutdown,
304 300
@@ -322,6 +318,7 @@ static const struct hc_driver ehci_fsl_hc_driver = {
322 .bus_suspend = ehci_bus_suspend, 318 .bus_suspend = ehci_bus_suspend,
323 .bus_resume = ehci_bus_resume, 319 .bus_resume = ehci_bus_resume,
324 .relinquish_port = ehci_relinquish_port, 320 .relinquish_port = ehci_relinquish_port,
321 .port_handed_over = ehci_port_handed_over,
325}; 322};
326 323
327static int ehci_fsl_drv_probe(struct platform_device *pdev) 324static int ehci_fsl_drv_probe(struct platform_device *pdev)
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 382587c4457c..740835bb8575 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -609,7 +609,7 @@ static int ehci_hub_control (
609 } 609 }
610 break; 610 break;
611 case USB_PORT_FEAT_C_SUSPEND: 611 case USB_PORT_FEAT_C_SUSPEND:
612 /* we auto-clear this feature */ 612 clear_bit(wIndex, &ehci->port_c_suspend);
613 break; 613 break;
614 case USB_PORT_FEAT_POWER: 614 case USB_PORT_FEAT_POWER:
615 if (HCS_PPC (ehci->hcs_params)) 615 if (HCS_PPC (ehci->hcs_params))
@@ -688,7 +688,7 @@ static int ehci_hub_control (
688 /* resume completed? */ 688 /* resume completed? */
689 else if (time_after_eq(jiffies, 689 else if (time_after_eq(jiffies,
690 ehci->reset_done[wIndex])) { 690 ehci->reset_done[wIndex])) {
691 status |= 1 << USB_PORT_FEAT_C_SUSPEND; 691 set_bit(wIndex, &ehci->port_c_suspend);
692 ehci->reset_done[wIndex] = 0; 692 ehci->reset_done[wIndex] = 0;
693 693
694 /* stop resume signaling */ 694 /* stop resume signaling */
@@ -765,6 +765,8 @@ static int ehci_hub_control (
765 status |= 1 << USB_PORT_FEAT_RESET; 765 status |= 1 << USB_PORT_FEAT_RESET;
766 if (temp & PORT_POWER) 766 if (temp & PORT_POWER)
767 status |= 1 << USB_PORT_FEAT_POWER; 767 status |= 1 << USB_PORT_FEAT_POWER;
768 if (test_bit(wIndex, &ehci->port_c_suspend))
769 status |= 1 << USB_PORT_FEAT_C_SUSPEND;
768 770
769#ifndef VERBOSE_DEBUG 771#ifndef VERBOSE_DEBUG
770 if (status & ~0xffff) /* only if wPortChange is interesting */ 772 if (status & ~0xffff) /* only if wPortChange is interesting */
@@ -875,3 +877,13 @@ static void ehci_relinquish_port(struct usb_hcd *hcd, int portnum)
875 set_owner(ehci, --portnum, PORT_OWNER); 877 set_owner(ehci, --portnum, PORT_OWNER);
876} 878}
877 879
880static int ehci_port_handed_over(struct usb_hcd *hcd, int portnum)
881{
882 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
883 u32 __iomem *reg;
884
885 if (ehci_is_TDI(ehci))
886 return 0;
887 reg = &ehci->regs->port_status[portnum - 1];
888 return ehci_readl(ehci, reg) & PORT_OWNER;
889}
diff --git a/drivers/usb/host/ehci-ixp4xx.c b/drivers/usb/host/ehci-ixp4xx.c
index 601c8795a854..9d042f220097 100644
--- a/drivers/usb/host/ehci-ixp4xx.c
+++ b/drivers/usb/host/ehci-ixp4xx.c
@@ -26,7 +26,7 @@ static int ixp4xx_ehci_init(struct usb_hcd *hcd)
26 + HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase)); 26 + HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
27 ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); 27 ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
28 28
29 ehci->is_tdi_rh_tt = 1; 29 hcd->has_tt = 1;
30 ehci_reset(ehci); 30 ehci_reset(ehci);
31 31
32 retval = ehci_init(hcd); 32 retval = ehci_init(hcd);
@@ -58,6 +58,8 @@ static const struct hc_driver ixp4xx_ehci_hc_driver = {
58 .bus_suspend = ehci_bus_suspend, 58 .bus_suspend = ehci_bus_suspend,
59 .bus_resume = ehci_bus_resume, 59 .bus_resume = ehci_bus_resume,
60#endif 60#endif
61 .relinquish_port = ehci_relinquish_port,
62 .port_handed_over = ehci_port_handed_over,
61}; 63};
62 64
63static int ixp4xx_ehci_probe(struct platform_device *pdev) 65static int ixp4xx_ehci_probe(struct platform_device *pdev)
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index d187d0313742..ab625f0ba1d9 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -115,6 +115,8 @@ static int ehci_orion_setup(struct usb_hcd *hcd)
115 if (retval) 115 if (retval)
116 return retval; 116 return retval;
117 117
118 hcd->has_tt = 1;
119
118 ehci_reset(ehci); 120 ehci_reset(ehci);
119 ehci_port_power(ehci, 0); 121 ehci_port_power(ehci, 0);
120 122
@@ -137,10 +139,6 @@ static const struct hc_driver ehci_orion_hc_driver = {
137 */ 139 */
138 .reset = ehci_orion_setup, 140 .reset = ehci_orion_setup,
139 .start = ehci_run, 141 .start = ehci_run,
140#ifdef CONFIG_PM
141 .suspend = ehci_bus_suspend,
142 .resume = ehci_bus_resume,
143#endif
144 .stop = ehci_stop, 142 .stop = ehci_stop,
145 .shutdown = ehci_shutdown, 143 .shutdown = ehci_shutdown,
146 144
@@ -163,6 +161,8 @@ static const struct hc_driver ehci_orion_hc_driver = {
163 .hub_control = ehci_hub_control, 161 .hub_control = ehci_hub_control,
164 .bus_suspend = ehci_bus_suspend, 162 .bus_suspend = ehci_bus_suspend,
165 .bus_resume = ehci_bus_resume, 163 .bus_resume = ehci_bus_resume,
164 .relinquish_port = ehci_relinquish_port,
165 .port_handed_over = ehci_port_handed_over,
166}; 166};
167 167
168static void __init 168static void __init
@@ -248,7 +248,7 @@ static int __init ehci_orion_drv_probe(struct platform_device *pdev)
248 ehci->regs = hcd->regs + 0x100 + 248 ehci->regs = hcd->regs + 0x100 +
249 HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase)); 249 HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
250 ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); 250 ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
251 ehci->is_tdi_rh_tt = 1; 251 hcd->has_tt = 1;
252 ehci->sbrn = 0x20; 252 ehci->sbrn = 0x20;
253 253
254 /* 254 /*
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 5bb7f6bb13f3..c46a58f9181d 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -129,7 +129,6 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
129 switch (pdev->vendor) { 129 switch (pdev->vendor) {
130 case PCI_VENDOR_ID_TDI: 130 case PCI_VENDOR_ID_TDI:
131 if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { 131 if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
132 ehci->is_tdi_rh_tt = 1;
133 hcd->has_tt = 1; 132 hcd->has_tt = 1;
134 tdi_reset(ehci); 133 tdi_reset(ehci);
135 } 134 }
@@ -379,7 +378,8 @@ static const struct hc_driver ehci_pci_hc_driver = {
379 .hub_control = ehci_hub_control, 378 .hub_control = ehci_hub_control,
380 .bus_suspend = ehci_bus_suspend, 379 .bus_suspend = ehci_bus_suspend,
381 .bus_resume = ehci_bus_resume, 380 .bus_resume = ehci_bus_resume,
382 .relinquish_port = ehci_relinquish_port, 381 .relinquish_port = ehci_relinquish_port,
382 .port_handed_over = ehci_port_handed_over,
383}; 383};
384 384
385/*-------------------------------------------------------------------------*/ 385/*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/ehci-ppc-of.c b/drivers/usb/host/ehci-ppc-of.c
index ee305b1f99ff..b018deed2e8f 100644
--- a/drivers/usb/host/ehci-ppc-of.c
+++ b/drivers/usb/host/ehci-ppc-of.c
@@ -76,6 +76,8 @@ static const struct hc_driver ehci_ppc_of_hc_driver = {
76 .bus_suspend = ehci_bus_suspend, 76 .bus_suspend = ehci_bus_suspend,
77 .bus_resume = ehci_bus_resume, 77 .bus_resume = ehci_bus_resume,
78#endif 78#endif
79 .relinquish_port = ehci_relinquish_port,
80 .port_handed_over = ehci_port_handed_over,
79}; 81};
80 82
81 83
diff --git a/drivers/usb/host/ehci-ppc-soc.c b/drivers/usb/host/ehci-ppc-soc.c
index 6c76036783a1..529590eb4037 100644
--- a/drivers/usb/host/ehci-ppc-soc.c
+++ b/drivers/usb/host/ehci-ppc-soc.c
@@ -163,6 +163,7 @@ static const struct hc_driver ehci_ppc_soc_hc_driver = {
163 .bus_suspend = ehci_bus_suspend, 163 .bus_suspend = ehci_bus_suspend,
164 .bus_resume = ehci_bus_resume, 164 .bus_resume = ehci_bus_resume,
165 .relinquish_port = ehci_relinquish_port, 165 .relinquish_port = ehci_relinquish_port,
166 .port_handed_over = ehci_port_handed_over,
166}; 167};
167 168
168static int ehci_hcd_ppc_soc_drv_probe(struct platform_device *pdev) 169static int ehci_hcd_ppc_soc_drv_probe(struct platform_device *pdev)
diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
index 69782221bcf3..37e6abeb794c 100644
--- a/drivers/usb/host/ehci-ps3.c
+++ b/drivers/usb/host/ehci-ps3.c
@@ -73,6 +73,7 @@ static const struct hc_driver ps3_ehci_hc_driver = {
73 .bus_resume = ehci_bus_resume, 73 .bus_resume = ehci_bus_resume,
74#endif 74#endif
75 .relinquish_port = ehci_relinquish_port, 75 .relinquish_port = ehci_relinquish_port,
76 .port_handed_over = ehci_port_handed_over,
76}; 77};
77 78
78static int ps3_ehci_probe(struct ps3_system_bus_device *dev) 79static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index be575e46eac3..b7853c8bac0f 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1349,18 +1349,27 @@ iso_stream_schedule (
1349 /* when's the last uframe this urb could start? */ 1349 /* when's the last uframe this urb could start? */
1350 max = now + mod; 1350 max = now + mod;
1351 1351
1352 /* typical case: reuse current schedule. stream is still active, 1352 /* Typical case: reuse current schedule, stream is still active.
1353 * and no gaps from host falling behind (irq delays etc) 1353 * Hopefully there are no gaps from the host falling behind
1354 * (irq delays etc), but if there are we'll take the next
1355 * slot in the schedule, implicitly assuming URB_ISO_ASAP.
1354 */ 1356 */
1355 if (likely (!list_empty (&stream->td_list))) { 1357 if (likely (!list_empty (&stream->td_list))) {
1356 start = stream->next_uframe; 1358 start = stream->next_uframe;
1357 if (start < now) 1359 if (start < now)
1358 start += mod; 1360 start += mod;
1359 if (likely ((start + sched->span) < max)) 1361
1360 goto ready; 1362 /* Fell behind (by up to twice the slop amount)? */
1361 /* else fell behind; someday, try to reschedule */ 1363 if (start >= max - 2 * 8 * SCHEDULE_SLOP)
1362 status = -EL2NSYNC; 1364 start += stream->interval * DIV_ROUND_UP(
1363 goto fail; 1365 max - start, stream->interval) - mod;
1366
1367 /* Tried to schedule too far into the future? */
1368 if (unlikely((start + sched->span) >= max)) {
1369 status = -EFBIG;
1370 goto fail;
1371 }
1372 goto ready;
1364 } 1373 }
1365 1374
1366 /* need to schedule; when's the next (u)frame we could start? 1375 /* need to schedule; when's the next (u)frame we could start?
@@ -1613,6 +1622,9 @@ itd_complete (
1613 } else if (likely ((t & EHCI_ISOC_ACTIVE) == 0)) { 1622 } else if (likely ((t & EHCI_ISOC_ACTIVE) == 0)) {
1614 desc->status = 0; 1623 desc->status = 0;
1615 desc->actual_length = EHCI_ITD_LENGTH (t); 1624 desc->actual_length = EHCI_ITD_LENGTH (t);
1625 } else {
1626 /* URB was too late */
1627 desc->status = -EXDEV;
1616 } 1628 }
1617 } 1629 }
1618 1630
@@ -2095,7 +2107,7 @@ done:
2095static void 2107static void
2096scan_periodic (struct ehci_hcd *ehci) 2108scan_periodic (struct ehci_hcd *ehci)
2097{ 2109{
2098 unsigned frame, clock, now_uframe, mod; 2110 unsigned now_uframe, frame, clock, clock_frame, mod;
2099 unsigned modified; 2111 unsigned modified;
2100 2112
2101 mod = ehci->periodic_size << 3; 2113 mod = ehci->periodic_size << 3;
@@ -2111,6 +2123,7 @@ scan_periodic (struct ehci_hcd *ehci)
2111 else 2123 else
2112 clock = now_uframe + mod - 1; 2124 clock = now_uframe + mod - 1;
2113 clock %= mod; 2125 clock %= mod;
2126 clock_frame = clock >> 3;
2114 2127
2115 for (;;) { 2128 for (;;) {
2116 union ehci_shadow q, *q_p; 2129 union ehci_shadow q, *q_p;
@@ -2157,22 +2170,26 @@ restart:
2157 case Q_TYPE_ITD: 2170 case Q_TYPE_ITD:
2158 /* If this ITD is still active, leave it for 2171 /* If this ITD is still active, leave it for
2159 * later processing ... check the next entry. 2172 * later processing ... check the next entry.
2173 * No need to check for activity unless the
2174 * frame is current.
2160 */ 2175 */
2161 rmb (); 2176 if (frame == clock_frame && live) {
2162 for (uf = 0; uf < 8 && live; uf++) { 2177 rmb();
2163 if (0 == (q.itd->hw_transaction [uf] 2178 for (uf = 0; uf < 8; uf++) {
2164 & ITD_ACTIVE(ehci))) 2179 if (q.itd->hw_transaction[uf] &
2165 continue; 2180 ITD_ACTIVE(ehci))
2166 incomplete = true; 2181 break;
2167 q_p = &q.itd->itd_next; 2182 }
2168 hw_p = &q.itd->hw_next; 2183 if (uf < 8) {
2169 type = Q_NEXT_TYPE(ehci, 2184 incomplete = true;
2185 q_p = &q.itd->itd_next;
2186 hw_p = &q.itd->hw_next;
2187 type = Q_NEXT_TYPE(ehci,
2170 q.itd->hw_next); 2188 q.itd->hw_next);
2171 q = *q_p; 2189 q = *q_p;
2172 break; 2190 break;
2191 }
2173 } 2192 }
2174 if (uf < 8 && live)
2175 break;
2176 2193
2177 /* Take finished ITDs out of the schedule 2194 /* Take finished ITDs out of the schedule
2178 * and process them: recycle, maybe report 2195 * and process them: recycle, maybe report
@@ -2189,9 +2206,12 @@ restart:
2189 case Q_TYPE_SITD: 2206 case Q_TYPE_SITD:
2190 /* If this SITD is still active, leave it for 2207 /* If this SITD is still active, leave it for
2191 * later processing ... check the next entry. 2208 * later processing ... check the next entry.
2209 * No need to check for activity unless the
2210 * frame is current.
2192 */ 2211 */
2193 if ((q.sitd->hw_results & SITD_ACTIVE(ehci)) 2212 if (frame == clock_frame && live &&
2194 && live) { 2213 (q.sitd->hw_results &
2214 SITD_ACTIVE(ehci))) {
2195 incomplete = true; 2215 incomplete = true;
2196 q_p = &q.sitd->sitd_next; 2216 q_p = &q.sitd->sitd_next;
2197 hw_p = &q.sitd->hw_next; 2217 hw_p = &q.sitd->hw_next;
@@ -2260,6 +2280,7 @@ restart:
2260 2280
2261 /* rescan the rest of this frame, then ... */ 2281 /* rescan the rest of this frame, then ... */
2262 clock = now; 2282 clock = now;
2283 clock_frame = clock >> 3;
2263 } else { 2284 } else {
2264 now_uframe++; 2285 now_uframe++;
2265 now_uframe %= mod; 2286 now_uframe %= mod;
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index bf92d209a1a9..90245fd8bac4 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -97,6 +97,8 @@ struct ehci_hcd { /* one per controller */
97 dedicated to the companion controller */ 97 dedicated to the companion controller */
98 unsigned long owned_ports; /* which ports are 98 unsigned long owned_ports; /* which ports are
99 owned by the companion during a bus suspend */ 99 owned by the companion during a bus suspend */
100 unsigned long port_c_suspend; /* which ports have
101 the change-suspend feature turned on */
100 102
101 /* per-HC memory pools (could be per-bus, but ...) */ 103 /* per-HC memory pools (could be per-bus, but ...) */
102 struct dma_pool *qh_pool; /* qh per active urb */ 104 struct dma_pool *qh_pool; /* qh per active urb */
@@ -112,7 +114,6 @@ struct ehci_hcd { /* one per controller */
112 u32 command; 114 u32 command;
113 115
114 /* SILICON QUIRKS */ 116 /* SILICON QUIRKS */
115 unsigned is_tdi_rh_tt:1; /* TDI roothub with TT */
116 unsigned no_selective_suspend:1; 117 unsigned no_selective_suspend:1;
117 unsigned has_fsl_port_bug:1; /* FreeScale */ 118 unsigned has_fsl_port_bug:1; /* FreeScale */
118 unsigned big_endian_mmio:1; 119 unsigned big_endian_mmio:1;
@@ -176,6 +177,15 @@ timer_action_done (struct ehci_hcd *ehci, enum ehci_timer_action action)
176static inline void 177static inline void
177timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action) 178timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action)
178{ 179{
180 /* Don't override timeouts which shrink or (later) disable
181 * the async ring; just the I/O watchdog. Note that if a
182 * SHRINK were pending, OFF would never be requested.
183 */
184 if (timer_pending(&ehci->watchdog)
185 && ((BIT(TIMER_ASYNC_SHRINK) | BIT(TIMER_ASYNC_OFF))
186 & ehci->actions))
187 return;
188
179 if (!test_and_set_bit (action, &ehci->actions)) { 189 if (!test_and_set_bit (action, &ehci->actions)) {
180 unsigned long t; 190 unsigned long t;
181 191
@@ -191,15 +201,7 @@ timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action)
191 t = EHCI_SHRINK_JIFFIES; 201 t = EHCI_SHRINK_JIFFIES;
192 break; 202 break;
193 } 203 }
194 t += jiffies; 204 mod_timer(&ehci->watchdog, t + jiffies);
195 // all timings except IAA watchdog can be overridden.
196 // async queue SHRINK often precedes IAA. while it's ready
197 // to go OFF neither can matter, and afterwards the IO
198 // watchdog stops unless there's still periodic traffic.
199 if (time_before_eq(t, ehci->watchdog.expires)
200 && timer_pending (&ehci->watchdog))
201 return;
202 mod_timer (&ehci->watchdog, t);
203 } 205 }
204} 206}
205 207
@@ -678,7 +680,7 @@ struct ehci_fstn {
678 * needed (mostly in root hub code). 680 * needed (mostly in root hub code).
679 */ 681 */
680 682
681#define ehci_is_TDI(e) ((e)->is_tdi_rh_tt) 683#define ehci_is_TDI(e) (ehci_to_hcd(e)->has_tt)
682 684
683/* Returns the speed of a device attached to a port on the root hub. */ 685/* Returns the speed of a device attached to a port on the root hub. */
684static inline unsigned int 686static inline unsigned int
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c
index c9cec8738261..65aa5ecf569a 100644
--- a/drivers/usb/host/isp1760-hcd.c
+++ b/drivers/usb/host/isp1760-hcd.c
@@ -2207,14 +2207,14 @@ struct usb_hcd *isp1760_register(u64 res_start, u64 res_len, int irq,
2207 goto err_put; 2207 goto err_put;
2208 } 2208 }
2209 2209
2210 ret = usb_add_hcd(hcd, irq, irqflags);
2211 if (ret)
2212 goto err_unmap;
2213
2214 hcd->irq = irq; 2210 hcd->irq = irq;
2215 hcd->rsrc_start = res_start; 2211 hcd->rsrc_start = res_start;
2216 hcd->rsrc_len = res_len; 2212 hcd->rsrc_len = res_len;
2217 2213
2214 ret = usb_add_hcd(hcd, irq, irqflags);
2215 if (ret)
2216 goto err_unmap;
2217
2218 return hcd; 2218 return hcd;
2219 2219
2220err_unmap: 2220err_unmap:
diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c
index 440bf94f0d4c..c9db3fe98726 100644
--- a/drivers/usb/host/isp1760-if.c
+++ b/drivers/usb/host/isp1760-if.c
@@ -104,8 +104,8 @@ static u32 nxp_pci_io_base;
104static u32 iolength; 104static u32 iolength;
105static u32 pci_mem_phy0; 105static u32 pci_mem_phy0;
106static u32 length; 106static u32 length;
107static u8 *chip_addr; 107static u8 __iomem *chip_addr;
108static u8 *iobase; 108static u8 __iomem *iobase;
109 109
110static int __devinit isp1761_pci_probe(struct pci_dev *dev, 110static int __devinit isp1761_pci_probe(struct pci_dev *dev,
111 const struct pci_device_id *id) 111 const struct pci_device_id *id)
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index c96db1153dcf..e534f9de0f05 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -261,6 +261,7 @@ static const struct hc_driver ohci_at91_hc_driver = {
261 */ 261 */
262 .hub_status_data = ohci_hub_status_data, 262 .hub_status_data = ohci_hub_status_data,
263 .hub_control = ohci_hub_control, 263 .hub_control = ohci_hub_control,
264 .hub_irq_enable = ohci_rhsc_enable,
264#ifdef CONFIG_PM 265#ifdef CONFIG_PM
265 .bus_suspend = ohci_bus_suspend, 266 .bus_suspend = ohci_bus_suspend,
266 .bus_resume = ohci_bus_resume, 267 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-au1xxx.c b/drivers/usb/host/ohci-au1xxx.c
index 1b9abdba920b..68c17f5ea8ea 100644
--- a/drivers/usb/host/ohci-au1xxx.c
+++ b/drivers/usb/host/ohci-au1xxx.c
@@ -8,7 +8,7 @@
8 * Bus Glue for AMD Alchemy Au1xxx 8 * Bus Glue for AMD Alchemy Au1xxx
9 * 9 *
10 * Written by Christopher Hoover <ch@hpl.hp.com> 10 * Written by Christopher Hoover <ch@hpl.hp.com>
11 * Based on fragments of previous driver by Rusell King et al. 11 * Based on fragments of previous driver by Russell King et al.
12 * 12 *
13 * Modified for LH7A404 from ohci-sa1111.c 13 * Modified for LH7A404 from ohci-sa1111.c
14 * by Durgesh Pattamatta <pattamattad@sharpsec.com> 14 * by Durgesh Pattamatta <pattamattad@sharpsec.com>
@@ -288,6 +288,7 @@ static const struct hc_driver ohci_au1xxx_hc_driver = {
288 */ 288 */
289 .hub_status_data = ohci_hub_status_data, 289 .hub_status_data = ohci_hub_status_data,
290 .hub_control = ohci_hub_control, 290 .hub_control = ohci_hub_control,
291 .hub_irq_enable = ohci_rhsc_enable,
291#ifdef CONFIG_PM 292#ifdef CONFIG_PM
292 .bus_suspend = ohci_bus_suspend, 293 .bus_suspend = ohci_bus_suspend,
293 .bus_resume = ohci_bus_resume, 294 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c
index 06aadfb0ec29..5adaf36e47d0 100644
--- a/drivers/usb/host/ohci-ep93xx.c
+++ b/drivers/usb/host/ohci-ep93xx.c
@@ -135,6 +135,7 @@ static struct hc_driver ohci_ep93xx_hc_driver = {
135 .get_frame_number = ohci_get_frame, 135 .get_frame_number = ohci_get_frame,
136 .hub_status_data = ohci_hub_status_data, 136 .hub_status_data = ohci_hub_status_data,
137 .hub_control = ohci_hub_control, 137 .hub_control = ohci_hub_control,
138 .hub_irq_enable = ohci_rhsc_enable,
138#ifdef CONFIG_PM 139#ifdef CONFIG_PM
139 .bus_suspend = ohci_bus_suspend, 140 .bus_suspend = ohci_bus_suspend,
140 .bus_resume = ohci_bus_resume, 141 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 33f1c1c32edf..a8160d65f32b 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1054,7 +1054,7 @@ MODULE_LICENSE ("GPL");
1054 1054
1055#ifdef CONFIG_MFD_SM501 1055#ifdef CONFIG_MFD_SM501
1056#include "ohci-sm501.c" 1056#include "ohci-sm501.c"
1057#define PLATFORM_DRIVER ohci_hcd_sm501_driver 1057#define SM501_OHCI_DRIVER ohci_hcd_sm501_driver
1058#endif 1058#endif
1059 1059
1060#if !defined(PCI_DRIVER) && \ 1060#if !defined(PCI_DRIVER) && \
@@ -1062,6 +1062,7 @@ MODULE_LICENSE ("GPL");
1062 !defined(OF_PLATFORM_DRIVER) && \ 1062 !defined(OF_PLATFORM_DRIVER) && \
1063 !defined(SA1111_DRIVER) && \ 1063 !defined(SA1111_DRIVER) && \
1064 !defined(PS3_SYSTEM_BUS_DRIVER) && \ 1064 !defined(PS3_SYSTEM_BUS_DRIVER) && \
1065 !defined(SM501_OHCI_DRIVER) && \
1065 !defined(SSB_OHCI_DRIVER) 1066 !defined(SSB_OHCI_DRIVER)
1066#error "missing bus glue for ohci-hcd" 1067#error "missing bus glue for ohci-hcd"
1067#endif 1068#endif
@@ -1121,9 +1122,18 @@ static int __init ohci_hcd_mod_init(void)
1121 goto error_ssb; 1122 goto error_ssb;
1122#endif 1123#endif
1123 1124
1125#ifdef SM501_OHCI_DRIVER
1126 retval = platform_driver_register(&SM501_OHCI_DRIVER);
1127 if (retval < 0)
1128 goto error_sm501;
1129#endif
1130
1124 return retval; 1131 return retval;
1125 1132
1126 /* Error path */ 1133 /* Error path */
1134#ifdef SM501_OHCI_DRIVER
1135 error_sm501:
1136#endif
1127#ifdef SSB_OHCI_DRIVER 1137#ifdef SSB_OHCI_DRIVER
1128 error_ssb: 1138 error_ssb:
1129#endif 1139#endif
@@ -1159,6 +1169,9 @@ module_init(ohci_hcd_mod_init);
1159 1169
1160static void __exit ohci_hcd_mod_exit(void) 1170static void __exit ohci_hcd_mod_exit(void)
1161{ 1171{
1172#ifdef SM501_OHCI_DRIVER
1173 platform_driver_unregister(&SM501_OHCI_DRIVER);
1174#endif
1162#ifdef SSB_OHCI_DRIVER 1175#ifdef SSB_OHCI_DRIVER
1163 ssb_driver_unregister(&SSB_OHCI_DRIVER); 1176 ssb_driver_unregister(&SSB_OHCI_DRIVER);
1164#endif 1177#endif
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index 79a78029f896..b56739221d11 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -36,6 +36,18 @@
36 36
37/*-------------------------------------------------------------------------*/ 37/*-------------------------------------------------------------------------*/
38 38
39/* hcd->hub_irq_enable() */
40static void ohci_rhsc_enable (struct usb_hcd *hcd)
41{
42 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
43
44 spin_lock_irq(&ohci->lock);
45 if (!ohci->autostop)
46 del_timer(&hcd->rh_timer); /* Prevent next poll */
47 ohci_writel(ohci, OHCI_INTR_RHSC, &ohci->regs->intrenable);
48 spin_unlock_irq(&ohci->lock);
49}
50
39#define OHCI_SCHED_ENABLES \ 51#define OHCI_SCHED_ENABLES \
40 (OHCI_CTRL_CLE|OHCI_CTRL_BLE|OHCI_CTRL_PLE|OHCI_CTRL_IE) 52 (OHCI_CTRL_CLE|OHCI_CTRL_BLE|OHCI_CTRL_PLE|OHCI_CTRL_IE)
41 53
@@ -362,28 +374,18 @@ static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed,
362 int any_connected) 374 int any_connected)
363{ 375{
364 int poll_rh = 1; 376 int poll_rh = 1;
365 int rhsc;
366 377
367 rhsc = ohci_readl(ohci, &ohci->regs->intrenable) & OHCI_INTR_RHSC;
368 switch (ohci->hc_control & OHCI_CTRL_HCFS) { 378 switch (ohci->hc_control & OHCI_CTRL_HCFS) {
369 379
370 case OHCI_USB_OPER: 380 case OHCI_USB_OPER:
371 /* If no status changes are pending, enable status-change 381 /* keep on polling until we know a device is connected
372 * interrupts. 382 * and RHSC is enabled */
373 */
374 if (!rhsc && !changed) {
375 rhsc = OHCI_INTR_RHSC;
376 ohci_writel(ohci, rhsc, &ohci->regs->intrenable);
377 }
378
379 /* Keep on polling until we know a device is connected
380 * and RHSC is enabled, or until we autostop.
381 */
382 if (!ohci->autostop) { 383 if (!ohci->autostop) {
383 if (any_connected || 384 if (any_connected ||
384 !device_may_wakeup(&ohci_to_hcd(ohci) 385 !device_may_wakeup(&ohci_to_hcd(ohci)
385 ->self.root_hub->dev)) { 386 ->self.root_hub->dev)) {
386 if (rhsc) 387 if (ohci_readl(ohci, &ohci->regs->intrenable) &
388 OHCI_INTR_RHSC)
387 poll_rh = 0; 389 poll_rh = 0;
388 } else { 390 } else {
389 ohci->autostop = 1; 391 ohci->autostop = 1;
@@ -396,13 +398,12 @@ static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed,
396 ohci->autostop = 0; 398 ohci->autostop = 0;
397 ohci->next_statechange = jiffies + 399 ohci->next_statechange = jiffies +
398 STATECHANGE_DELAY; 400 STATECHANGE_DELAY;
399 } else if (rhsc && time_after_eq(jiffies, 401 } else if (time_after_eq(jiffies,
400 ohci->next_statechange) 402 ohci->next_statechange)
401 && !ohci->ed_rm_list 403 && !ohci->ed_rm_list
402 && !(ohci->hc_control & 404 && !(ohci->hc_control &
403 OHCI_SCHED_ENABLES)) { 405 OHCI_SCHED_ENABLES)) {
404 ohci_rh_suspend(ohci, 1); 406 ohci_rh_suspend(ohci, 1);
405 poll_rh = 0;
406 } 407 }
407 } 408 }
408 break; 409 break;
@@ -416,12 +417,6 @@ static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed,
416 else 417 else
417 usb_hcd_resume_root_hub(ohci_to_hcd(ohci)); 418 usb_hcd_resume_root_hub(ohci_to_hcd(ohci));
418 } else { 419 } else {
419 if (!rhsc && (ohci->autostop ||
420 ohci_to_hcd(ohci)->self.root_hub->
421 do_remote_wakeup))
422 ohci_writel(ohci, OHCI_INTR_RHSC,
423 &ohci->regs->intrenable);
424
425 /* everything is idle, no need for polling */ 420 /* everything is idle, no need for polling */
426 poll_rh = 0; 421 poll_rh = 0;
427 } 422 }
@@ -443,16 +438,12 @@ static inline int ohci_rh_resume(struct ohci_hcd *ohci)
443static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed, 438static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed,
444 int any_connected) 439 int any_connected)
445{ 440{
446 /* If RHSC is enabled, don't poll */ 441 int poll_rh = 1;
447 if (ohci_readl(ohci, &ohci->regs->intrenable) & OHCI_INTR_RHSC)
448 return 0;
449 442
450 /* If no status changes are pending, enable status-change interrupts */ 443 /* keep on polling until RHSC is enabled */
451 if (!changed) { 444 if (ohci_readl(ohci, &ohci->regs->intrenable) & OHCI_INTR_RHSC)
452 ohci_writel(ohci, OHCI_INTR_RHSC, &ohci->regs->intrenable); 445 poll_rh = 0;
453 return 0; 446 return poll_rh;
454 }
455 return 1;
456} 447}
457 448
458#endif /* CONFIG_PM */ 449#endif /* CONFIG_PM */
diff --git a/drivers/usb/host/ohci-lh7a404.c b/drivers/usb/host/ohci-lh7a404.c
index 96d14fa1d833..1ef5d482c145 100644
--- a/drivers/usb/host/ohci-lh7a404.c
+++ b/drivers/usb/host/ohci-lh7a404.c
@@ -8,7 +8,7 @@
8 * Bus Glue for Sharp LH7A404 8 * Bus Glue for Sharp LH7A404
9 * 9 *
10 * Written by Christopher Hoover <ch@hpl.hp.com> 10 * Written by Christopher Hoover <ch@hpl.hp.com>
11 * Based on fragments of previous driver by Rusell King et al. 11 * Based on fragments of previous driver by Russell King et al.
12 * 12 *
13 * Modified for LH7A404 from ohci-sa1111.c 13 * Modified for LH7A404 from ohci-sa1111.c
14 * by Durgesh Pattamatta <pattamattad@sharpsec.com> 14 * by Durgesh Pattamatta <pattamattad@sharpsec.com>
@@ -193,6 +193,7 @@ static const struct hc_driver ohci_lh7a404_hc_driver = {
193 */ 193 */
194 .hub_status_data = ohci_hub_status_data, 194 .hub_status_data = ohci_hub_status_data,
195 .hub_control = ohci_hub_control, 195 .hub_control = ohci_hub_control,
196 .hub_irq_enable = ohci_rhsc_enable,
196#ifdef CONFIG_PM 197#ifdef CONFIG_PM
197 .bus_suspend = ohci_bus_suspend, 198 .bus_suspend = ohci_bus_suspend,
198 .bus_resume = ohci_bus_resume, 199 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 6859fb5f1d6f..3a7c24c03671 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -466,6 +466,7 @@ static const struct hc_driver ohci_omap_hc_driver = {
466 */ 466 */
467 .hub_status_data = ohci_hub_status_data, 467 .hub_status_data = ohci_hub_status_data,
468 .hub_control = ohci_hub_control, 468 .hub_control = ohci_hub_control,
469 .hub_irq_enable = ohci_rhsc_enable,
469#ifdef CONFIG_PM 470#ifdef CONFIG_PM
470 .bus_suspend = ohci_bus_suspend, 471 .bus_suspend = ohci_bus_suspend,
471 .bus_resume = ohci_bus_resume, 472 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
index 3bf175d95a23..4696cc912e16 100644
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -327,6 +327,7 @@ static const struct hc_driver ohci_pci_hc_driver = {
327 */ 327 */
328 .hub_status_data = ohci_hub_status_data, 328 .hub_status_data = ohci_hub_status_data,
329 .hub_control = ohci_hub_control, 329 .hub_control = ohci_hub_control,
330 .hub_irq_enable = ohci_rhsc_enable,
330#ifdef CONFIG_PM 331#ifdef CONFIG_PM
331 .bus_suspend = ohci_bus_suspend, 332 .bus_suspend = ohci_bus_suspend,
332 .bus_resume = ohci_bus_resume, 333 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-pnx4008.c b/drivers/usb/host/ohci-pnx4008.c
index 664f07ee8732..28b458f20cc3 100644
--- a/drivers/usb/host/ohci-pnx4008.c
+++ b/drivers/usb/host/ohci-pnx4008.c
@@ -280,6 +280,7 @@ static const struct hc_driver ohci_pnx4008_hc_driver = {
280 */ 280 */
281 .hub_status_data = ohci_hub_status_data, 281 .hub_status_data = ohci_hub_status_data,
282 .hub_control = ohci_hub_control, 282 .hub_control = ohci_hub_control,
283 .hub_irq_enable = ohci_rhsc_enable,
283#ifdef CONFIG_PM 284#ifdef CONFIG_PM
284 .bus_suspend = ohci_bus_suspend, 285 .bus_suspend = ohci_bus_suspend,
285 .bus_resume = ohci_bus_resume, 286 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-pnx8550.c b/drivers/usb/host/ohci-pnx8550.c
index 28467e288a93..605d59cba28e 100644
--- a/drivers/usb/host/ohci-pnx8550.c
+++ b/drivers/usb/host/ohci-pnx8550.c
@@ -201,6 +201,7 @@ static const struct hc_driver ohci_pnx8550_hc_driver = {
201 */ 201 */
202 .hub_status_data = ohci_hub_status_data, 202 .hub_status_data = ohci_hub_status_data,
203 .hub_control = ohci_hub_control, 203 .hub_control = ohci_hub_control,
204 .hub_irq_enable = ohci_rhsc_enable,
204#ifdef CONFIG_PM 205#ifdef CONFIG_PM
205 .bus_suspend = ohci_bus_suspend, 206 .bus_suspend = ohci_bus_suspend,
206 .bus_resume = ohci_bus_resume, 207 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-ppc-of.c b/drivers/usb/host/ohci-ppc-of.c
index 50e55db13636..a67252791223 100644
--- a/drivers/usb/host/ohci-ppc-of.c
+++ b/drivers/usb/host/ohci-ppc-of.c
@@ -72,6 +72,7 @@ static const struct hc_driver ohci_ppc_of_hc_driver = {
72 */ 72 */
73 .hub_status_data = ohci_hub_status_data, 73 .hub_status_data = ohci_hub_status_data,
74 .hub_control = ohci_hub_control, 74 .hub_control = ohci_hub_control,
75 .hub_irq_enable = ohci_rhsc_enable,
75#ifdef CONFIG_PM 76#ifdef CONFIG_PM
76 .bus_suspend = ohci_bus_suspend, 77 .bus_suspend = ohci_bus_suspend,
77 .bus_resume = ohci_bus_resume, 78 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-ppc-soc.c b/drivers/usb/host/ohci-ppc-soc.c
index cd3398b675b2..523c30125577 100644
--- a/drivers/usb/host/ohci-ppc-soc.c
+++ b/drivers/usb/host/ohci-ppc-soc.c
@@ -172,6 +172,7 @@ static const struct hc_driver ohci_ppc_soc_hc_driver = {
172 */ 172 */
173 .hub_status_data = ohci_hub_status_data, 173 .hub_status_data = ohci_hub_status_data,
174 .hub_control = ohci_hub_control, 174 .hub_control = ohci_hub_control,
175 .hub_irq_enable = ohci_rhsc_enable,
175#ifdef CONFIG_PM 176#ifdef CONFIG_PM
176 .bus_suspend = ohci_bus_suspend, 177 .bus_suspend = ohci_bus_suspend,
177 .bus_resume = ohci_bus_resume, 178 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c
index bfdeb0d22d05..c1935ae537f8 100644
--- a/drivers/usb/host/ohci-ps3.c
+++ b/drivers/usb/host/ohci-ps3.c
@@ -68,6 +68,7 @@ static const struct hc_driver ps3_ohci_hc_driver = {
68 .get_frame_number = ohci_get_frame, 68 .get_frame_number = ohci_get_frame,
69 .hub_status_data = ohci_hub_status_data, 69 .hub_status_data = ohci_hub_status_data,
70 .hub_control = ohci_hub_control, 70 .hub_control = ohci_hub_control,
71 .hub_irq_enable = ohci_rhsc_enable,
71 .start_port_reset = ohci_start_port_reset, 72 .start_port_reset = ohci_start_port_reset,
72#if defined(CONFIG_PM) 73#if defined(CONFIG_PM)
73 .bus_suspend = ohci_bus_suspend, 74 .bus_suspend = ohci_bus_suspend,
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 70b0d4b459e7..d4ee27d92be8 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -298,6 +298,7 @@ static const struct hc_driver ohci_pxa27x_hc_driver = {
298 */ 298 */
299 .hub_status_data = ohci_hub_status_data, 299 .hub_status_data = ohci_hub_status_data,
300 .hub_control = ohci_hub_control, 300 .hub_control = ohci_hub_control,
301 .hub_irq_enable = ohci_rhsc_enable,
301#ifdef CONFIG_PM 302#ifdef CONFIG_PM
302 .bus_suspend = ohci_bus_suspend, 303 .bus_suspend = ohci_bus_suspend,
303 .bus_resume = ohci_bus_resume, 304 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
index 9c9f3b59186f..9b547407c934 100644
--- a/drivers/usb/host/ohci-q.c
+++ b/drivers/usb/host/ohci-q.c
@@ -952,6 +952,7 @@ rescan_this:
952 struct urb *urb; 952 struct urb *urb;
953 urb_priv_t *urb_priv; 953 urb_priv_t *urb_priv;
954 __hc32 savebits; 954 __hc32 savebits;
955 u32 tdINFO;
955 956
956 td = list_entry (entry, struct td, td_list); 957 td = list_entry (entry, struct td, td_list);
957 urb = td->urb; 958 urb = td->urb;
@@ -966,6 +967,17 @@ rescan_this:
966 savebits = *prev & ~cpu_to_hc32 (ohci, TD_MASK); 967 savebits = *prev & ~cpu_to_hc32 (ohci, TD_MASK);
967 *prev = td->hwNextTD | savebits; 968 *prev = td->hwNextTD | savebits;
968 969
970 /* If this was unlinked, the TD may not have been
971 * retired ... so manually save the data toggle.
972 * The controller ignores the value we save for
973 * control and ISO endpoints.
974 */
975 tdINFO = hc32_to_cpup(ohci, &td->hwINFO);
976 if ((tdINFO & TD_T) == TD_T_DATA0)
977 ed->hwHeadP &= ~cpu_to_hc32(ohci, ED_C);
978 else if ((tdINFO & TD_T) == TD_T_DATA1)
979 ed->hwHeadP |= cpu_to_hc32(ohci, ED_C);
980
969 /* HC may have partly processed this TD */ 981 /* HC may have partly processed this TD */
970 td_done (ohci, urb, td); 982 td_done (ohci, urb, td);
971 urb_priv->td_cnt++; 983 urb_priv->td_cnt++;
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index a73d2ff322e2..3c7a740cfe0c 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -8,7 +8,7 @@
8 * USB Bus Glue for Samsung S3C2410 8 * USB Bus Glue for Samsung S3C2410
9 * 9 *
10 * Written by Christopher Hoover <ch@hpl.hp.com> 10 * Written by Christopher Hoover <ch@hpl.hp.com>
11 * Based on fragments of previous driver by Rusell King et al. 11 * Based on fragments of previous driver by Russell King et al.
12 * 12 *
13 * Modified for S3C2410 from ohci-sa1111.c, ohci-omap.c and ohci-lh7a40.c 13 * Modified for S3C2410 from ohci-sa1111.c, ohci-omap.c and ohci-lh7a40.c
14 * by Ben Dooks, <ben@simtec.co.uk> 14 * by Ben Dooks, <ben@simtec.co.uk>
@@ -466,6 +466,7 @@ static const struct hc_driver ohci_s3c2410_hc_driver = {
466 */ 466 */
467 .hub_status_data = ohci_s3c2410_hub_status_data, 467 .hub_status_data = ohci_s3c2410_hub_status_data,
468 .hub_control = ohci_s3c2410_hub_control, 468 .hub_control = ohci_s3c2410_hub_control,
469 .hub_irq_enable = ohci_rhsc_enable,
469#ifdef CONFIG_PM 470#ifdef CONFIG_PM
470 .bus_suspend = ohci_bus_suspend, 471 .bus_suspend = ohci_bus_suspend,
471 .bus_resume = ohci_bus_resume, 472 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c
index 99438c65981b..2e9dceb9bb99 100644
--- a/drivers/usb/host/ohci-sa1111.c
+++ b/drivers/usb/host/ohci-sa1111.c
@@ -8,7 +8,7 @@
8 * SA1111 Bus Glue 8 * SA1111 Bus Glue
9 * 9 *
10 * Written by Christopher Hoover <ch@hpl.hp.com> 10 * Written by Christopher Hoover <ch@hpl.hp.com>
11 * Based on fragments of previous driver by Rusell King et al. 11 * Based on fragments of previous driver by Russell King et al.
12 * 12 *
13 * This file is licenced under the GPL. 13 * This file is licenced under the GPL.
14 */ 14 */
@@ -231,6 +231,7 @@ static const struct hc_driver ohci_sa1111_hc_driver = {
231 */ 231 */
232 .hub_status_data = ohci_hub_status_data, 232 .hub_status_data = ohci_hub_status_data,
233 .hub_control = ohci_hub_control, 233 .hub_control = ohci_hub_control,
234 .hub_irq_enable = ohci_rhsc_enable,
234#ifdef CONFIG_PM 235#ifdef CONFIG_PM
235 .bus_suspend = ohci_bus_suspend, 236 .bus_suspend = ohci_bus_suspend,
236 .bus_resume = ohci_bus_resume, 237 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-sh.c b/drivers/usb/host/ohci-sh.c
index 60f03cc7ec4f..e7ee607278fe 100644
--- a/drivers/usb/host/ohci-sh.c
+++ b/drivers/usb/host/ohci-sh.c
@@ -68,6 +68,7 @@ static const struct hc_driver ohci_sh_hc_driver = {
68 */ 68 */
69 .hub_status_data = ohci_hub_status_data, 69 .hub_status_data = ohci_hub_status_data,
70 .hub_control = ohci_hub_control, 70 .hub_control = ohci_hub_control,
71 .hub_irq_enable = ohci_rhsc_enable,
71#ifdef CONFIG_PM 72#ifdef CONFIG_PM
72 .bus_suspend = ohci_bus_suspend, 73 .bus_suspend = ohci_bus_suspend,
73 .bus_resume = ohci_bus_resume, 74 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
index e899a77dfb83..e610698c6b60 100644
--- a/drivers/usb/host/ohci-sm501.c
+++ b/drivers/usb/host/ohci-sm501.c
@@ -75,6 +75,7 @@ static const struct hc_driver ohci_sm501_hc_driver = {
75 */ 75 */
76 .hub_status_data = ohci_hub_status_data, 76 .hub_status_data = ohci_hub_status_data,
77 .hub_control = ohci_hub_control, 77 .hub_control = ohci_hub_control,
78 .hub_irq_enable = ohci_rhsc_enable,
78#ifdef CONFIG_PM 79#ifdef CONFIG_PM
79 .bus_suspend = ohci_bus_suspend, 80 .bus_suspend = ohci_bus_suspend,
80 .bus_resume = ohci_bus_resume, 81 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/ohci-ssb.c b/drivers/usb/host/ohci-ssb.c
index c4265caec780..7275186db315 100644
--- a/drivers/usb/host/ohci-ssb.c
+++ b/drivers/usb/host/ohci-ssb.c
@@ -81,6 +81,7 @@ static const struct hc_driver ssb_ohci_hc_driver = {
81 81
82 .hub_status_data = ohci_hub_status_data, 82 .hub_status_data = ohci_hub_status_data,
83 .hub_control = ohci_hub_control, 83 .hub_control = ohci_hub_control,
84 .hub_irq_enable = ohci_rhsc_enable,
84#ifdef CONFIG_PM 85#ifdef CONFIG_PM
85 .bus_suspend = ohci_bus_suspend, 86 .bus_suspend = ohci_bus_suspend,
86 .bus_resume = ohci_bus_resume, 87 .bus_resume = ohci_bus_resume,
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index f29307405bb3..9b6323f768b2 100644
--- a/drivers/usb/host/u132-hcd.c
+++ b/drivers/usb/host/u132-hcd.c
@@ -2934,6 +2934,16 @@ static int u132_start_port_reset(struct usb_hcd *hcd, unsigned port_num)
2934 return 0; 2934 return 0;
2935} 2935}
2936 2936
2937static void u132_hub_irq_enable(struct usb_hcd *hcd)
2938{
2939 struct u132 *u132 = hcd_to_u132(hcd);
2940 if (u132->going > 1) {
2941 dev_err(&u132->platform_dev->dev, "device has been removed %d\n"
2942 , u132->going);
2943 } else if (u132->going > 0)
2944 dev_err(&u132->platform_dev->dev, "device is being removed\n");
2945}
2946
2937 2947
2938#ifdef CONFIG_PM 2948#ifdef CONFIG_PM
2939static int u132_bus_suspend(struct usb_hcd *hcd) 2949static int u132_bus_suspend(struct usb_hcd *hcd)
@@ -2985,6 +2995,7 @@ static struct hc_driver u132_hc_driver = {
2985 .bus_suspend = u132_bus_suspend, 2995 .bus_suspend = u132_bus_suspend,
2986 .bus_resume = u132_bus_resume, 2996 .bus_resume = u132_bus_resume,
2987 .start_port_reset = u132_start_port_reset, 2997 .start_port_reset = u132_start_port_reset,
2998 .hub_irq_enable = u132_hub_irq_enable,
2988}; 2999};
2989 3000
2990/* 3001/*
diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
index a53db1d4e07a..001789c9a11a 100644
--- a/drivers/usb/misc/Kconfig
+++ b/drivers/usb/misc/Kconfig
@@ -269,3 +269,15 @@ config USB_TEST
269 See <http://www.linux-usb.org/usbtest/> for more information, 269 See <http://www.linux-usb.org/usbtest/> for more information,
270 including sample test device firmware and "how to use it". 270 including sample test device firmware and "how to use it".
271 271
272config USB_ISIGHTFW
273 tristate "iSight firmware loading support"
274 depends on USB
275 select FW_LOADER
276 help
277 This driver loads firmware for USB Apple iSight cameras, allowing
278 them to be driven by the USB video class driver available at
279 http://linux-uvc.berlios.de
280
281 The firmware for this driver must be extracted from the MacOS
282 driver beforehand. Tools for doing so are available at
283 http://bersace03.free.fr
diff --git a/drivers/usb/misc/Makefile b/drivers/usb/misc/Makefile
index b68e6b774f1a..aba091cb5ec0 100644
--- a/drivers/usb/misc/Makefile
+++ b/drivers/usb/misc/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_USB_EMI62) += emi62.o
14obj-$(CONFIG_USB_FTDI_ELAN) += ftdi-elan.o 14obj-$(CONFIG_USB_FTDI_ELAN) += ftdi-elan.o
15obj-$(CONFIG_USB_IDMOUSE) += idmouse.o 15obj-$(CONFIG_USB_IDMOUSE) += idmouse.o
16obj-$(CONFIG_USB_IOWARRIOR) += iowarrior.o 16obj-$(CONFIG_USB_IOWARRIOR) += iowarrior.o
17obj-$(CONFIG_USB_ISIGHTFW) += isight_firmware.o
17obj-$(CONFIG_USB_LCD) += usblcd.o 18obj-$(CONFIG_USB_LCD) += usblcd.o
18obj-$(CONFIG_USB_LD) += ldusb.o 19obj-$(CONFIG_USB_LD) += ldusb.o
19obj-$(CONFIG_USB_LED) += usbled.o 20obj-$(CONFIG_USB_LED) += usbled.o
diff --git a/drivers/usb/misc/isight_firmware.c b/drivers/usb/misc/isight_firmware.c
new file mode 100644
index 000000000000..9f30aa1f8a5d
--- /dev/null
+++ b/drivers/usb/misc/isight_firmware.c
@@ -0,0 +1,140 @@
1/*
2 * Driver for loading USB isight firmware
3 *
4 * Copyright (C) 2008 Matthew Garrett <mjg@redhat.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation, version 2.
9 *
10 * The USB isight cameras in recent Apples are roughly compatible with the USB
11 * video class specification, and can be driven by uvcvideo. However, they
12 * need firmware to be loaded beforehand. After firmware loading, the device
13 * detaches from the USB bus and reattaches with a new device ID. It can then
14 * be claimed by the uvc driver.
15 *
16 * The firmware is non-free and must be extracted by the user. Tools to do this
17 * are available at http://bersace03.free.fr/ift/
18 *
19 * The isight firmware loading was reverse engineered by Johannes Berg
20 * <johannes@sipsolutions.de>, and this driver is based on code by Ronald
21 * Bultje <rbultje@ronald.bitfreak.net>
22 */
23
24#include <linux/usb.h>
25#include <linux/firmware.h>
26#include <linux/errno.h>
27#include <linux/module.h>
28
29static struct usb_device_id id_table[] = {
30 {USB_DEVICE(0x05ac, 0x8300)},
31 {},
32};
33
34MODULE_DEVICE_TABLE(usb, id_table);
35
36static int isight_firmware_load(struct usb_interface *intf,
37 const struct usb_device_id *id)
38{
39 struct usb_device *dev = interface_to_usbdev(intf);
40 int llen, len, req, ret = 0;
41 const struct firmware *firmware;
42 unsigned char *buf = kmalloc(50, GFP_KERNEL);
43 unsigned char data[4];
44 u8 *ptr;
45
46 if (!buf)
47 return -ENOMEM;
48
49 if (request_firmware(&firmware, "isight.fw", &dev->dev) != 0) {
50 printk(KERN_ERR "Unable to load isight firmware\n");
51 return -ENODEV;
52 }
53
54 ptr = firmware->data;
55
56 if (usb_control_msg
57 (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, "\1", 1,
58 300) != 1) {
59 printk(KERN_ERR
60 "Failed to initialise isight firmware loader\n");
61 ret = -ENODEV;
62 goto out;
63 }
64
65 while (ptr+4 <= firmware->data+firmware->size) {
66 memcpy(data, ptr, 4);
67 len = (data[0] << 8 | data[1]);
68 req = (data[2] << 8 | data[3]);
69 ptr += 4;
70
71 if (len == 0x8001)
72 break; /* success */
73 else if (len == 0)
74 continue;
75
76 for (; len > 0; req += 50) {
77 llen = min(len, 50);
78 len -= llen;
79 if (ptr+llen > firmware->data+firmware->size) {
80 printk(KERN_ERR
81 "Malformed isight firmware");
82 ret = -ENODEV;
83 goto out;
84 }
85 memcpy(buf, ptr, llen);
86
87 ptr += llen;
88
89 if (usb_control_msg
90 (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, req, 0,
91 buf, llen, 300) != llen) {
92 printk(KERN_ERR
93 "Failed to load isight firmware\n");
94 kfree(buf);
95 ret = -ENODEV;
96 goto out;
97 }
98
99 }
100 }
101
102 if (usb_control_msg
103 (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, "\0", 1,
104 300) != 1) {
105 printk(KERN_ERR "isight firmware loading completion failed\n");
106 ret = -ENODEV;
107 }
108
109out:
110 kfree(buf);
111 release_firmware(firmware);
112 return ret;
113}
114
115static void isight_firmware_disconnect(struct usb_interface *intf)
116{
117}
118
119static struct usb_driver isight_firmware_driver = {
120 .name = "isight_firmware",
121 .probe = isight_firmware_load,
122 .disconnect = isight_firmware_disconnect,
123 .id_table = id_table,
124};
125
126static int __init isight_firmware_init(void)
127{
128 return usb_register(&isight_firmware_driver);
129}
130
131static void __exit isight_firmware_exit(void)
132{
133 usb_deregister(&isight_firmware_driver);
134}
135
136module_init(isight_firmware_init);
137module_exit(isight_firmware_exit);
138
139MODULE_LICENSE("GPL");
140MODULE_AUTHOR("Matthew Garrett <mjg@redhat.com>");
diff --git a/drivers/usb/misc/phidgetkit.c b/drivers/usb/misc/phidgetkit.c
index 24230c638b8e..4cfa25b0f44e 100644
--- a/drivers/usb/misc/phidgetkit.c
+++ b/drivers/usb/misc/phidgetkit.c
@@ -595,14 +595,14 @@ static int interfacekit_probe(struct usb_interface *intf, const struct usb_devic
595 } while(value); 595 } while(value);
596 kit->dev_no = bit; 596 kit->dev_no = bit;
597 597
598 kit->dev = device_create(phidget_class, &kit->udev->dev, 0, 598 kit->dev = device_create_drvdata(phidget_class, &kit->udev->dev,
599 "interfacekit%d", kit->dev_no); 599 MKDEV(0, 0), kit,
600 "interfacekit%d", kit->dev_no);
600 if (IS_ERR(kit->dev)) { 601 if (IS_ERR(kit->dev)) {
601 rc = PTR_ERR(kit->dev); 602 rc = PTR_ERR(kit->dev);
602 kit->dev = NULL; 603 kit->dev = NULL;
603 goto out; 604 goto out;
604 } 605 }
605 dev_set_drvdata(kit->dev, kit);
606 606
607 if (usb_submit_urb(kit->irq, GFP_KERNEL)) { 607 if (usb_submit_urb(kit->irq, GFP_KERNEL)) {
608 rc = -EIO; 608 rc = -EIO;
diff --git a/drivers/usb/misc/phidgetmotorcontrol.c b/drivers/usb/misc/phidgetmotorcontrol.c
index f0113c17cc5a..9b4696f21b22 100644
--- a/drivers/usb/misc/phidgetmotorcontrol.c
+++ b/drivers/usb/misc/phidgetmotorcontrol.c
@@ -365,16 +365,15 @@ static int motorcontrol_probe(struct usb_interface *intf, const struct usb_devic
365 } while(value); 365 } while(value);
366 mc->dev_no = bit; 366 mc->dev_no = bit;
367 367
368 mc->dev = device_create(phidget_class, &mc->udev->dev, 0, 368 mc->dev = device_create_drvdata(phidget_class, &mc->udev->dev,
369 "motorcontrol%d", mc->dev_no); 369 MKDEV(0, 0), mc,
370 "motorcontrol%d", mc->dev_no);
370 if (IS_ERR(mc->dev)) { 371 if (IS_ERR(mc->dev)) {
371 rc = PTR_ERR(mc->dev); 372 rc = PTR_ERR(mc->dev);
372 mc->dev = NULL; 373 mc->dev = NULL;
373 goto out; 374 goto out;
374 } 375 }
375 376
376 dev_set_drvdata(mc->dev, mc);
377
378 if (usb_submit_urb(mc->irq, GFP_KERNEL)) { 377 if (usb_submit_urb(mc->irq, GFP_KERNEL)) {
379 rc = -EIO; 378 rc = -EIO;
380 goto out; 379 goto out;
diff --git a/drivers/usb/misc/phidgetservo.c b/drivers/usb/misc/phidgetservo.c
index 7d590c09434a..1ca7ddb41d4d 100644
--- a/drivers/usb/misc/phidgetservo.c
+++ b/drivers/usb/misc/phidgetservo.c
@@ -275,14 +275,14 @@ servo_probe(struct usb_interface *interface, const struct usb_device_id *id)
275 } while (value); 275 } while (value);
276 dev->dev_no = bit; 276 dev->dev_no = bit;
277 277
278 dev->dev = device_create(phidget_class, &dev->udev->dev, 0, 278 dev->dev = device_create_drvdata(phidget_class, &dev->udev->dev,
279 "servo%d", dev->dev_no); 279 MKDEV(0, 0), dev,
280 "servo%d", dev->dev_no);
280 if (IS_ERR(dev->dev)) { 281 if (IS_ERR(dev->dev)) {
281 rc = PTR_ERR(dev->dev); 282 rc = PTR_ERR(dev->dev);
282 dev->dev = NULL; 283 dev->dev = NULL;
283 goto out; 284 goto out;
284 } 285 }
285 dev_set_drvdata(dev->dev, dev);
286 286
287 servo_count = dev->type & SERVO_COUNT_QUAD ? 4 : 1; 287 servo_count = dev->type & SERVO_COUNT_QUAD ? 4 : 1;
288 288
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
index cb7fa0eaf3ae..33182f4c2267 100644
--- a/drivers/usb/misc/sisusbvga/sisusb.c
+++ b/drivers/usb/misc/sisusbvga/sisusb.c
@@ -3264,8 +3264,6 @@ static void sisusb_disconnect(struct usb_interface *intf)
3264 3264
3265 /* decrement our usage count */ 3265 /* decrement our usage count */
3266 kref_put(&sisusb->kref, sisusb_delete); 3266 kref_put(&sisusb->kref, sisusb_delete);
3267
3268 dev_info(&sisusb->sisusb_dev->dev, "Disconnected\n");
3269} 3267}
3270 3268
3271static struct usb_device_id sisusb_table [] = { 3269static struct usb_device_id sisusb_table [] = {
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index ba28fdc9ccd2..1f7c86bd8297 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -28,6 +28,7 @@ static int debug;
28 28
29static struct usb_device_id id_table [] = { 29static struct usb_device_id id_table [] = {
30 { USB_DEVICE(0x4348, 0x5523) }, 30 { USB_DEVICE(0x4348, 0x5523) },
31 { USB_DEVICE(0x1a86, 0x7523) },
31 { }, 32 { },
32}; 33};
33MODULE_DEVICE_TABLE(usb, id_table); 34MODULE_DEVICE_TABLE(usb, id_table);
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 5b349ece7247..0ff4a3971e45 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -174,8 +174,270 @@ static struct usb_device_id id_table_combined [] = {
174 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) }, 174 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) },
175 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) }, 175 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) },
176 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, 176 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) },
177 { USB_DEVICE(MTXORB_VK_VID, MTXORB_VK_PID), 177 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0100_PID) },
178 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0101_PID) },
179 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0102_PID) },
180 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0103_PID) },
181 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0104_PID) },
182 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0105_PID) },
183 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0106_PID) },
184 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0107_PID) },
185 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0108_PID) },
186 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0109_PID) },
187 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_010A_PID) },
188 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_010B_PID) },
189 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_010C_PID) },
190 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_010D_PID) },
191 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_010E_PID) },
192 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_010F_PID) },
193 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0110_PID) },
194 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0111_PID) },
195 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0112_PID) },
196 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0113_PID) },
197 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0114_PID) },
198 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0115_PID) },
199 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0116_PID) },
200 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0117_PID) },
201 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0118_PID) },
202 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0119_PID) },
203 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_011A_PID) },
204 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_011B_PID) },
205 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_011C_PID) },
206 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_011D_PID) },
207 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_011E_PID) },
208 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_011F_PID) },
209 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0120_PID) },
210 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0121_PID) },
211 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0122_PID) },
212 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0123_PID) },
213 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0124_PID) },
214 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0125_PID) },
215 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0126_PID) },
216 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0127_PID),
178 .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 217 .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk },
218 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0128_PID) },
219 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0129_PID) },
220 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_012A_PID) },
221 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_012B_PID) },
222 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_012C_PID),
223 .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk },
224 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_012D_PID) },
225 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_012E_PID) },
226 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_012F_PID) },
227 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0130_PID) },
228 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0131_PID) },
229 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0132_PID) },
230 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0133_PID) },
231 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0134_PID) },
232 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0135_PID) },
233 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0136_PID) },
234 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0137_PID) },
235 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0138_PID) },
236 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0139_PID) },
237 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_013A_PID) },
238 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_013B_PID) },
239 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_013C_PID) },
240 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_013D_PID) },
241 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_013E_PID) },
242 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_013F_PID) },
243 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0140_PID) },
244 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0141_PID) },
245 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0142_PID) },
246 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0143_PID) },
247 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0144_PID) },
248 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0145_PID) },
249 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0146_PID) },
250 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0147_PID) },
251 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0148_PID) },
252 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0149_PID) },
253 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_014A_PID) },
254 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_014B_PID) },
255 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_014C_PID) },
256 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_014D_PID) },
257 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_014E_PID) },
258 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_014F_PID) },
259 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0150_PID) },
260 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0151_PID) },
261 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0152_PID) },
262 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0153_PID),
263 .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk },
264 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0154_PID),
265 .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk },
266 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0155_PID),
267 .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk },
268 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0156_PID),
269 .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk },
270 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0157_PID),
271 .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk },
272 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0158_PID),
273 .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk },
274 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0159_PID) },
275 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_015A_PID) },
276 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_015B_PID) },
277 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_015C_PID) },
278 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_015D_PID) },
279 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_015E_PID) },
280 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_015F_PID) },
281 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0160_PID) },
282 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0161_PID) },
283 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0162_PID) },
284 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0163_PID) },
285 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0164_PID) },
286 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0165_PID) },
287 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0166_PID) },
288 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0167_PID) },
289 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0168_PID) },
290 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0169_PID) },
291 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_016A_PID) },
292 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_016B_PID) },
293 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_016C_PID) },
294 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_016D_PID) },
295 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_016E_PID) },
296 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_016F_PID) },
297 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0170_PID) },
298 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0171_PID) },
299 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0172_PID) },
300 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0173_PID) },
301 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0174_PID) },
302 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0175_PID) },
303 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0176_PID) },
304 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0177_PID) },
305 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0178_PID) },
306 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0179_PID) },
307 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_017A_PID) },
308 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_017B_PID) },
309 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_017C_PID) },
310 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_017D_PID) },
311 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_017E_PID) },
312 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_017F_PID) },
313 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0180_PID) },
314 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0181_PID) },
315 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0182_PID) },
316 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0183_PID) },
317 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0184_PID) },
318 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0185_PID) },
319 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0186_PID) },
320 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0187_PID) },
321 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0188_PID) },
322 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0189_PID) },
323 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_018A_PID) },
324 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_018B_PID) },
325 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_018C_PID) },
326 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_018D_PID) },
327 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_018E_PID) },
328 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_018F_PID) },
329 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0190_PID) },
330 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0191_PID) },
331 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0192_PID) },
332 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0193_PID) },
333 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0194_PID) },
334 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0195_PID) },
335 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0196_PID) },
336 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0197_PID) },
337 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0198_PID) },
338 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_0199_PID) },
339 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_019A_PID) },
340 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_019B_PID) },
341 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_019C_PID) },
342 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_019D_PID) },
343 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_019E_PID) },
344 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_019F_PID) },
345 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01A0_PID) },
346 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01A1_PID) },
347 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01A2_PID) },
348 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01A3_PID) },
349 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01A4_PID) },
350 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01A5_PID) },
351 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01A6_PID) },
352 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01A7_PID) },
353 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01A8_PID) },
354 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01A9_PID) },
355 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01AA_PID) },
356 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01AB_PID) },
357 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01AC_PID) },
358 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01AD_PID) },
359 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01AE_PID) },
360 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01AF_PID) },
361 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01B0_PID) },
362 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01B1_PID) },
363 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01B2_PID) },
364 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01B3_PID) },
365 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01B4_PID) },
366 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01B5_PID) },
367 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01B6_PID) },
368 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01B7_PID) },
369 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01B8_PID) },
370 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01B9_PID) },
371 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01BA_PID) },
372 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01BB_PID) },
373 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01BC_PID) },
374 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01BD_PID) },
375 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01BE_PID) },
376 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01BF_PID) },
377 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01C0_PID) },
378 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01C1_PID) },
379 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01C2_PID) },
380 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01C3_PID) },
381 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01C4_PID) },
382 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01C5_PID) },
383 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01C6_PID) },
384 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01C7_PID) },
385 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01C8_PID) },
386 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01C9_PID) },
387 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01CA_PID) },
388 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01CB_PID) },
389 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01CC_PID) },
390 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01CD_PID) },
391 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01CE_PID) },
392 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01CF_PID) },
393 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01D0_PID) },
394 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01D1_PID) },
395 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01D2_PID) },
396 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01D3_PID) },
397 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01D4_PID) },
398 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01D5_PID) },
399 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01D6_PID) },
400 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01D7_PID) },
401 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01D8_PID) },
402 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01D9_PID) },
403 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01DA_PID) },
404 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01DB_PID) },
405 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01DC_PID) },
406 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01DD_PID) },
407 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01DE_PID) },
408 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01DF_PID) },
409 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01E0_PID) },
410 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01E1_PID) },
411 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01E2_PID) },
412 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01E3_PID) },
413 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01E4_PID) },
414 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01E5_PID) },
415 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01E6_PID) },
416 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01E7_PID) },
417 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01E8_PID) },
418 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01E9_PID) },
419 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01EA_PID) },
420 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01EB_PID) },
421 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01EC_PID) },
422 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01ED_PID) },
423 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01EE_PID) },
424 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01EF_PID) },
425 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01F0_PID) },
426 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01F1_PID) },
427 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01F2_PID) },
428 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01F3_PID) },
429 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01F4_PID) },
430 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01F5_PID) },
431 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01F6_PID) },
432 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01F7_PID) },
433 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01F8_PID) },
434 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01F9_PID) },
435 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01FA_PID) },
436 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01FB_PID) },
437 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01FC_PID) },
438 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01FD_PID) },
439 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01FE_PID) },
440 { USB_DEVICE(MTXORB_VID,MTXORB_FTDI_RANGE_01FF_PID) },
179 { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, 441 { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) },
180 { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, 442 { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
181 { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) }, 443 { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
@@ -374,6 +636,8 @@ static struct usb_device_id id_table_combined [] = {
374 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 636 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
375 { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), 637 { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID),
376 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 638 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
639 { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
640 { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
377 { }, /* Optional parameter entry */ 641 { }, /* Optional parameter entry */
378 { } /* Terminating entry */ 642 { } /* Terminating entry */
379}; 643};
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index 504edf8c3a3f..8302eca893ea 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -114,11 +114,268 @@
114#define FTDI_OOCDLINK_PID 0xbaf8 /* Amontec JTAGkey */ 114#define FTDI_OOCDLINK_PID 0xbaf8 /* Amontec JTAGkey */
115 115
116/* 116/*
117 * The following are the values for the Matrix Orbital VK204-25-USB 117 * The following are the values for the Matrix Orbital FTDI Range
118 * display, which use the FT232RL. 118 * Anything in this range will use an FT232RL.
119 */ 119 */
120#define MTXORB_VK_VID 0x1b3d 120#define MTXORB_VID 0x1B3D
121#define MTXORB_VK_PID 0x0158 121#define MTXORB_FTDI_RANGE_0100_PID 0x0100
122#define MTXORB_FTDI_RANGE_0101_PID 0x0101
123#define MTXORB_FTDI_RANGE_0102_PID 0x0102
124#define MTXORB_FTDI_RANGE_0103_PID 0x0103
125#define MTXORB_FTDI_RANGE_0104_PID 0x0104
126#define MTXORB_FTDI_RANGE_0105_PID 0x0105
127#define MTXORB_FTDI_RANGE_0106_PID 0x0106
128#define MTXORB_FTDI_RANGE_0107_PID 0x0107
129#define MTXORB_FTDI_RANGE_0108_PID 0x0108
130#define MTXORB_FTDI_RANGE_0109_PID 0x0109
131#define MTXORB_FTDI_RANGE_010A_PID 0x010A
132#define MTXORB_FTDI_RANGE_010B_PID 0x010B
133#define MTXORB_FTDI_RANGE_010C_PID 0x010C
134#define MTXORB_FTDI_RANGE_010D_PID 0x010D
135#define MTXORB_FTDI_RANGE_010E_PID 0x010E
136#define MTXORB_FTDI_RANGE_010F_PID 0x010F
137#define MTXORB_FTDI_RANGE_0110_PID 0x0110
138#define MTXORB_FTDI_RANGE_0111_PID 0x0111
139#define MTXORB_FTDI_RANGE_0112_PID 0x0112
140#define MTXORB_FTDI_RANGE_0113_PID 0x0113
141#define MTXORB_FTDI_RANGE_0114_PID 0x0114
142#define MTXORB_FTDI_RANGE_0115_PID 0x0115
143#define MTXORB_FTDI_RANGE_0116_PID 0x0116
144#define MTXORB_FTDI_RANGE_0117_PID 0x0117
145#define MTXORB_FTDI_RANGE_0118_PID 0x0118
146#define MTXORB_FTDI_RANGE_0119_PID 0x0119
147#define MTXORB_FTDI_RANGE_011A_PID 0x011A
148#define MTXORB_FTDI_RANGE_011B_PID 0x011B
149#define MTXORB_FTDI_RANGE_011C_PID 0x011C
150#define MTXORB_FTDI_RANGE_011D_PID 0x011D
151#define MTXORB_FTDI_RANGE_011E_PID 0x011E
152#define MTXORB_FTDI_RANGE_011F_PID 0x011F
153#define MTXORB_FTDI_RANGE_0120_PID 0x0120
154#define MTXORB_FTDI_RANGE_0121_PID 0x0121
155#define MTXORB_FTDI_RANGE_0122_PID 0x0122
156#define MTXORB_FTDI_RANGE_0123_PID 0x0123
157#define MTXORB_FTDI_RANGE_0124_PID 0x0124
158#define MTXORB_FTDI_RANGE_0125_PID 0x0125
159#define MTXORB_FTDI_RANGE_0126_PID 0x0126
160#define MTXORB_FTDI_RANGE_0127_PID 0x0127
161#define MTXORB_FTDI_RANGE_0128_PID 0x0128
162#define MTXORB_FTDI_RANGE_0129_PID 0x0129
163#define MTXORB_FTDI_RANGE_012A_PID 0x012A
164#define MTXORB_FTDI_RANGE_012B_PID 0x012B
165#define MTXORB_FTDI_RANGE_012C_PID 0x012C
166#define MTXORB_FTDI_RANGE_012D_PID 0x012D
167#define MTXORB_FTDI_RANGE_012E_PID 0x012E
168#define MTXORB_FTDI_RANGE_012F_PID 0x012F
169#define MTXORB_FTDI_RANGE_0130_PID 0x0130
170#define MTXORB_FTDI_RANGE_0131_PID 0x0131
171#define MTXORB_FTDI_RANGE_0132_PID 0x0132
172#define MTXORB_FTDI_RANGE_0133_PID 0x0133
173#define MTXORB_FTDI_RANGE_0134_PID 0x0134
174#define MTXORB_FTDI_RANGE_0135_PID 0x0135
175#define MTXORB_FTDI_RANGE_0136_PID 0x0136
176#define MTXORB_FTDI_RANGE_0137_PID 0x0137
177#define MTXORB_FTDI_RANGE_0138_PID 0x0138
178#define MTXORB_FTDI_RANGE_0139_PID 0x0139
179#define MTXORB_FTDI_RANGE_013A_PID 0x013A
180#define MTXORB_FTDI_RANGE_013B_PID 0x013B
181#define MTXORB_FTDI_RANGE_013C_PID 0x013C
182#define MTXORB_FTDI_RANGE_013D_PID 0x013D
183#define MTXORB_FTDI_RANGE_013E_PID 0x013E
184#define MTXORB_FTDI_RANGE_013F_PID 0x013F
185#define MTXORB_FTDI_RANGE_0140_PID 0x0140
186#define MTXORB_FTDI_RANGE_0141_PID 0x0141
187#define MTXORB_FTDI_RANGE_0142_PID 0x0142
188#define MTXORB_FTDI_RANGE_0143_PID 0x0143
189#define MTXORB_FTDI_RANGE_0144_PID 0x0144
190#define MTXORB_FTDI_RANGE_0145_PID 0x0145
191#define MTXORB_FTDI_RANGE_0146_PID 0x0146
192#define MTXORB_FTDI_RANGE_0147_PID 0x0147
193#define MTXORB_FTDI_RANGE_0148_PID 0x0148
194#define MTXORB_FTDI_RANGE_0149_PID 0x0149
195#define MTXORB_FTDI_RANGE_014A_PID 0x014A
196#define MTXORB_FTDI_RANGE_014B_PID 0x014B
197#define MTXORB_FTDI_RANGE_014C_PID 0x014C
198#define MTXORB_FTDI_RANGE_014D_PID 0x014D
199#define MTXORB_FTDI_RANGE_014E_PID 0x014E
200#define MTXORB_FTDI_RANGE_014F_PID 0x014F
201#define MTXORB_FTDI_RANGE_0150_PID 0x0150
202#define MTXORB_FTDI_RANGE_0151_PID 0x0151
203#define MTXORB_FTDI_RANGE_0152_PID 0x0152
204#define MTXORB_FTDI_RANGE_0153_PID 0x0153
205#define MTXORB_FTDI_RANGE_0154_PID 0x0154
206#define MTXORB_FTDI_RANGE_0155_PID 0x0155
207#define MTXORB_FTDI_RANGE_0156_PID 0x0156
208#define MTXORB_FTDI_RANGE_0157_PID 0x0157
209#define MTXORB_FTDI_RANGE_0158_PID 0x0158
210#define MTXORB_FTDI_RANGE_0159_PID 0x0159
211#define MTXORB_FTDI_RANGE_015A_PID 0x015A
212#define MTXORB_FTDI_RANGE_015B_PID 0x015B
213#define MTXORB_FTDI_RANGE_015C_PID 0x015C
214#define MTXORB_FTDI_RANGE_015D_PID 0x015D
215#define MTXORB_FTDI_RANGE_015E_PID 0x015E
216#define MTXORB_FTDI_RANGE_015F_PID 0x015F
217#define MTXORB_FTDI_RANGE_0160_PID 0x0160
218#define MTXORB_FTDI_RANGE_0161_PID 0x0161
219#define MTXORB_FTDI_RANGE_0162_PID 0x0162
220#define MTXORB_FTDI_RANGE_0163_PID 0x0163
221#define MTXORB_FTDI_RANGE_0164_PID 0x0164
222#define MTXORB_FTDI_RANGE_0165_PID 0x0165
223#define MTXORB_FTDI_RANGE_0166_PID 0x0166
224#define MTXORB_FTDI_RANGE_0167_PID 0x0167
225#define MTXORB_FTDI_RANGE_0168_PID 0x0168
226#define MTXORB_FTDI_RANGE_0169_PID 0x0169
227#define MTXORB_FTDI_RANGE_016A_PID 0x016A
228#define MTXORB_FTDI_RANGE_016B_PID 0x016B
229#define MTXORB_FTDI_RANGE_016C_PID 0x016C
230#define MTXORB_FTDI_RANGE_016D_PID 0x016D
231#define MTXORB_FTDI_RANGE_016E_PID 0x016E
232#define MTXORB_FTDI_RANGE_016F_PID 0x016F
233#define MTXORB_FTDI_RANGE_0170_PID 0x0170
234#define MTXORB_FTDI_RANGE_0171_PID 0x0171
235#define MTXORB_FTDI_RANGE_0172_PID 0x0172
236#define MTXORB_FTDI_RANGE_0173_PID 0x0173
237#define MTXORB_FTDI_RANGE_0174_PID 0x0174
238#define MTXORB_FTDI_RANGE_0175_PID 0x0175
239#define MTXORB_FTDI_RANGE_0176_PID 0x0176
240#define MTXORB_FTDI_RANGE_0177_PID 0x0177
241#define MTXORB_FTDI_RANGE_0178_PID 0x0178
242#define MTXORB_FTDI_RANGE_0179_PID 0x0179
243#define MTXORB_FTDI_RANGE_017A_PID 0x017A
244#define MTXORB_FTDI_RANGE_017B_PID 0x017B
245#define MTXORB_FTDI_RANGE_017C_PID 0x017C
246#define MTXORB_FTDI_RANGE_017D_PID 0x017D
247#define MTXORB_FTDI_RANGE_017E_PID 0x017E
248#define MTXORB_FTDI_RANGE_017F_PID 0x017F
249#define MTXORB_FTDI_RANGE_0180_PID 0x0180
250#define MTXORB_FTDI_RANGE_0181_PID 0x0181
251#define MTXORB_FTDI_RANGE_0182_PID 0x0182
252#define MTXORB_FTDI_RANGE_0183_PID 0x0183
253#define MTXORB_FTDI_RANGE_0184_PID 0x0184
254#define MTXORB_FTDI_RANGE_0185_PID 0x0185
255#define MTXORB_FTDI_RANGE_0186_PID 0x0186
256#define MTXORB_FTDI_RANGE_0187_PID 0x0187
257#define MTXORB_FTDI_RANGE_0188_PID 0x0188
258#define MTXORB_FTDI_RANGE_0189_PID 0x0189
259#define MTXORB_FTDI_RANGE_018A_PID 0x018A
260#define MTXORB_FTDI_RANGE_018B_PID 0x018B
261#define MTXORB_FTDI_RANGE_018C_PID 0x018C
262#define MTXORB_FTDI_RANGE_018D_PID 0x018D
263#define MTXORB_FTDI_RANGE_018E_PID 0x018E
264#define MTXORB_FTDI_RANGE_018F_PID 0x018F
265#define MTXORB_FTDI_RANGE_0190_PID 0x0190
266#define MTXORB_FTDI_RANGE_0191_PID 0x0191
267#define MTXORB_FTDI_RANGE_0192_PID 0x0192
268#define MTXORB_FTDI_RANGE_0193_PID 0x0193
269#define MTXORB_FTDI_RANGE_0194_PID 0x0194
270#define MTXORB_FTDI_RANGE_0195_PID 0x0195
271#define MTXORB_FTDI_RANGE_0196_PID 0x0196
272#define MTXORB_FTDI_RANGE_0197_PID 0x0197
273#define MTXORB_FTDI_RANGE_0198_PID 0x0198
274#define MTXORB_FTDI_RANGE_0199_PID 0x0199
275#define MTXORB_FTDI_RANGE_019A_PID 0x019A
276#define MTXORB_FTDI_RANGE_019B_PID 0x019B
277#define MTXORB_FTDI_RANGE_019C_PID 0x019C
278#define MTXORB_FTDI_RANGE_019D_PID 0x019D
279#define MTXORB_FTDI_RANGE_019E_PID 0x019E
280#define MTXORB_FTDI_RANGE_019F_PID 0x019F
281#define MTXORB_FTDI_RANGE_01A0_PID 0x01A0
282#define MTXORB_FTDI_RANGE_01A1_PID 0x01A1
283#define MTXORB_FTDI_RANGE_01A2_PID 0x01A2
284#define MTXORB_FTDI_RANGE_01A3_PID 0x01A3
285#define MTXORB_FTDI_RANGE_01A4_PID 0x01A4
286#define MTXORB_FTDI_RANGE_01A5_PID 0x01A5
287#define MTXORB_FTDI_RANGE_01A6_PID 0x01A6
288#define MTXORB_FTDI_RANGE_01A7_PID 0x01A7
289#define MTXORB_FTDI_RANGE_01A8_PID 0x01A8
290#define MTXORB_FTDI_RANGE_01A9_PID 0x01A9
291#define MTXORB_FTDI_RANGE_01AA_PID 0x01AA
292#define MTXORB_FTDI_RANGE_01AB_PID 0x01AB
293#define MTXORB_FTDI_RANGE_01AC_PID 0x01AC
294#define MTXORB_FTDI_RANGE_01AD_PID 0x01AD
295#define MTXORB_FTDI_RANGE_01AE_PID 0x01AE
296#define MTXORB_FTDI_RANGE_01AF_PID 0x01AF
297#define MTXORB_FTDI_RANGE_01B0_PID 0x01B0
298#define MTXORB_FTDI_RANGE_01B1_PID 0x01B1
299#define MTXORB_FTDI_RANGE_01B2_PID 0x01B2
300#define MTXORB_FTDI_RANGE_01B3_PID 0x01B3
301#define MTXORB_FTDI_RANGE_01B4_PID 0x01B4
302#define MTXORB_FTDI_RANGE_01B5_PID 0x01B5
303#define MTXORB_FTDI_RANGE_01B6_PID 0x01B6
304#define MTXORB_FTDI_RANGE_01B7_PID 0x01B7
305#define MTXORB_FTDI_RANGE_01B8_PID 0x01B8
306#define MTXORB_FTDI_RANGE_01B9_PID 0x01B9
307#define MTXORB_FTDI_RANGE_01BA_PID 0x01BA
308#define MTXORB_FTDI_RANGE_01BB_PID 0x01BB
309#define MTXORB_FTDI_RANGE_01BC_PID 0x01BC
310#define MTXORB_FTDI_RANGE_01BD_PID 0x01BD
311#define MTXORB_FTDI_RANGE_01BE_PID 0x01BE
312#define MTXORB_FTDI_RANGE_01BF_PID 0x01BF
313#define MTXORB_FTDI_RANGE_01C0_PID 0x01C0
314#define MTXORB_FTDI_RANGE_01C1_PID 0x01C1
315#define MTXORB_FTDI_RANGE_01C2_PID 0x01C2
316#define MTXORB_FTDI_RANGE_01C3_PID 0x01C3
317#define MTXORB_FTDI_RANGE_01C4_PID 0x01C4
318#define MTXORB_FTDI_RANGE_01C5_PID 0x01C5
319#define MTXORB_FTDI_RANGE_01C6_PID 0x01C6
320#define MTXORB_FTDI_RANGE_01C7_PID 0x01C7
321#define MTXORB_FTDI_RANGE_01C8_PID 0x01C8
322#define MTXORB_FTDI_RANGE_01C9_PID 0x01C9
323#define MTXORB_FTDI_RANGE_01CA_PID 0x01CA
324#define MTXORB_FTDI_RANGE_01CB_PID 0x01CB
325#define MTXORB_FTDI_RANGE_01CC_PID 0x01CC
326#define MTXORB_FTDI_RANGE_01CD_PID 0x01CD
327#define MTXORB_FTDI_RANGE_01CE_PID 0x01CE
328#define MTXORB_FTDI_RANGE_01CF_PID 0x01CF
329#define MTXORB_FTDI_RANGE_01D0_PID 0x01D0
330#define MTXORB_FTDI_RANGE_01D1_PID 0x01D1
331#define MTXORB_FTDI_RANGE_01D2_PID 0x01D2
332#define MTXORB_FTDI_RANGE_01D3_PID 0x01D3
333#define MTXORB_FTDI_RANGE_01D4_PID 0x01D4
334#define MTXORB_FTDI_RANGE_01D5_PID 0x01D5
335#define MTXORB_FTDI_RANGE_01D6_PID 0x01D6
336#define MTXORB_FTDI_RANGE_01D7_PID 0x01D7
337#define MTXORB_FTDI_RANGE_01D8_PID 0x01D8
338#define MTXORB_FTDI_RANGE_01D9_PID 0x01D9
339#define MTXORB_FTDI_RANGE_01DA_PID 0x01DA
340#define MTXORB_FTDI_RANGE_01DB_PID 0x01DB
341#define MTXORB_FTDI_RANGE_01DC_PID 0x01DC
342#define MTXORB_FTDI_RANGE_01DD_PID 0x01DD
343#define MTXORB_FTDI_RANGE_01DE_PID 0x01DE
344#define MTXORB_FTDI_RANGE_01DF_PID 0x01DF
345#define MTXORB_FTDI_RANGE_01E0_PID 0x01E0
346#define MTXORB_FTDI_RANGE_01E1_PID 0x01E1
347#define MTXORB_FTDI_RANGE_01E2_PID 0x01E2
348#define MTXORB_FTDI_RANGE_01E3_PID 0x01E3
349#define MTXORB_FTDI_RANGE_01E4_PID 0x01E4
350#define MTXORB_FTDI_RANGE_01E5_PID 0x01E5
351#define MTXORB_FTDI_RANGE_01E6_PID 0x01E6
352#define MTXORB_FTDI_RANGE_01E7_PID 0x01E7
353#define MTXORB_FTDI_RANGE_01E8_PID 0x01E8
354#define MTXORB_FTDI_RANGE_01E9_PID 0x01E9
355#define MTXORB_FTDI_RANGE_01EA_PID 0x01EA
356#define MTXORB_FTDI_RANGE_01EB_PID 0x01EB
357#define MTXORB_FTDI_RANGE_01EC_PID 0x01EC
358#define MTXORB_FTDI_RANGE_01ED_PID 0x01ED
359#define MTXORB_FTDI_RANGE_01EE_PID 0x01EE
360#define MTXORB_FTDI_RANGE_01EF_PID 0x01EF
361#define MTXORB_FTDI_RANGE_01F0_PID 0x01F0
362#define MTXORB_FTDI_RANGE_01F1_PID 0x01F1
363#define MTXORB_FTDI_RANGE_01F2_PID 0x01F2
364#define MTXORB_FTDI_RANGE_01F3_PID 0x01F3
365#define MTXORB_FTDI_RANGE_01F4_PID 0x01F4
366#define MTXORB_FTDI_RANGE_01F5_PID 0x01F5
367#define MTXORB_FTDI_RANGE_01F6_PID 0x01F6
368#define MTXORB_FTDI_RANGE_01F7_PID 0x01F7
369#define MTXORB_FTDI_RANGE_01F8_PID 0x01F8
370#define MTXORB_FTDI_RANGE_01F9_PID 0x01F9
371#define MTXORB_FTDI_RANGE_01FA_PID 0x01FA
372#define MTXORB_FTDI_RANGE_01FB_PID 0x01FB
373#define MTXORB_FTDI_RANGE_01FC_PID 0x01FC
374#define MTXORB_FTDI_RANGE_01FD_PID 0x01FD
375#define MTXORB_FTDI_RANGE_01FE_PID 0x01FE
376#define MTXORB_FTDI_RANGE_01FF_PID 0x01FF
377
378
122 379
123/* Interbiometrics USB I/O Board */ 380/* Interbiometrics USB I/O Board */
124/* Developed for Interbiometrics by Rudolf Gugler */ 381/* Developed for Interbiometrics by Rudolf Gugler */
@@ -571,6 +828,9 @@
571/* Propox devices */ 828/* Propox devices */
572#define FTDI_PROPOX_JTAGCABLEII_PID 0xD738 829#define FTDI_PROPOX_JTAGCABLEII_PID 0xD738
573 830
831/* Rig Expert Ukraine devices */
832#define FTDI_REU_TINY_PID 0xED22 /* RigExpert Tiny */
833
574/* Commands */ 834/* Commands */
575#define FTDI_SIO_RESET 0 /* Reset the port */ 835#define FTDI_SIO_RESET 0 /* Reset the port */
576#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ 836#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
@@ -592,6 +852,12 @@
592#define FIC_NEO1973_DEBUG_PID 0x5118 852#define FIC_NEO1973_DEBUG_PID 0x5118
593 853
594/* 854/*
855 * RATOC REX-USB60F
856 */
857#define RATOC_VENDOR_ID 0x0584
858#define RATOC_PRODUCT_ID_USB60F 0xb020
859
860/*
595 * BmRequestType: 1100 0000b 861 * BmRequestType: 1100 0000b
596 * bRequest: FTDI_E2_READ 862 * bRequest: FTDI_E2_READ
597 * wValue: 0 863 * wValue: 0
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index ea924dc48496..d9fb3768a2d7 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -570,7 +570,12 @@ static struct usb_serial_driver ipaq_device = {
570 .description = "PocketPC PDA", 570 .description = "PocketPC PDA",
571 .usb_driver = &ipaq_driver, 571 .usb_driver = &ipaq_driver,
572 .id_table = ipaq_id_table, 572 .id_table = ipaq_id_table,
573 .num_ports = 2, 573 /*
574 * some devices have an extra endpoint, which
575 * must be ignored as it would make the core
576 * create a second port which oopses when used
577 */
578 .num_ports = 1,
574 .open = ipaq_open, 579 .open = ipaq_open,
575 .close = ipaq_close, 580 .close = ipaq_close,
576 .attach = ipaq_startup, 581 .attach = ipaq_startup,
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index e7e016e60333..a73420dd052a 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -183,6 +183,7 @@ static int option_send_setup(struct usb_serial_port *port);
183#define AXESSTEL_PRODUCT_MV110H 0x1000 183#define AXESSTEL_PRODUCT_MV110H 0x1000
184 184
185#define ONDA_VENDOR_ID 0x19d2 185#define ONDA_VENDOR_ID 0x19d2
186#define ONDA_PRODUCT_MSA501HS 0x0001
186#define ONDA_PRODUCT_ET502HS 0x0002 187#define ONDA_PRODUCT_ET502HS 0x0002
187 188
188#define BANDRICH_VENDOR_ID 0x1A8D 189#define BANDRICH_VENDOR_ID 0x1A8D
@@ -196,6 +197,9 @@ static int option_send_setup(struct usb_serial_port *port);
196 197
197#define MAXON_VENDOR_ID 0x16d8 198#define MAXON_VENDOR_ID 0x16d8
198 199
200#define TELIT_VENDOR_ID 0x1bc7
201#define TELIT_PRODUCT_UC864E 0x1003
202
199static struct usb_device_id option_ids[] = { 203static struct usb_device_id option_ids[] = {
200 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, 204 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
201 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, 205 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -232,25 +236,25 @@ static struct usb_device_id option_ids[] = {
232 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_NETWORK_EX) }, 236 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_NETWORK_EX) },
233 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_MODEM) }, 237 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_MODEM) },
234 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) }, 238 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) },
235 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 239 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600, 0xff, 0xff, 0xff) },
236 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220, 0xff, 0xff, 0xff) }, 240 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220, 0xff, 0xff, 0xff) },
237 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220BIS, 0xff, 0xff, 0xff) }, 241 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220BIS, 0xff, 0xff, 0xff) },
238 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1401) }, 242 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1401, 0xff, 0xff, 0xff) },
239 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1403) }, 243 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1403, 0xff, 0xff, 0xff) },
240 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1405) }, 244 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1405, 0xff, 0xff, 0xff) },
241 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1406) }, 245 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1406, 0xff, 0xff, 0xff) },
242 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1408) }, 246 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1408, 0xff, 0xff, 0xff) },
243 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1409) }, 247 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1409, 0xff, 0xff, 0xff) },
244 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1410) }, 248 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1410, 0xff, 0xff, 0xff) },
245 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1411) }, 249 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1411, 0xff, 0xff, 0xff) },
246 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1412) }, 250 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1412, 0xff, 0xff, 0xff) },
247 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1413) }, 251 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1413, 0xff, 0xff, 0xff) },
248 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1414) }, 252 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1414, 0xff, 0xff, 0xff) },
249 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1415) }, 253 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1415, 0xff, 0xff, 0xff) },
250 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1416) }, 254 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1416, 0xff, 0xff, 0xff) },
251 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1417) }, 255 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1417, 0xff, 0xff, 0xff) },
252 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1418) }, 256 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1418, 0xff, 0xff, 0xff) },
253 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1419) }, 257 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1419, 0xff, 0xff, 0xff) },
254 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_9508) }, 258 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_9508) },
255 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, /* Novatel Merlin V640/XV620 */ 259 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, /* Novatel Merlin V640/XV620 */
256 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) }, /* Novatel Merlin V620/S620 */ 260 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) }, /* Novatel Merlin V620/S620 */
@@ -297,13 +301,15 @@ static struct usb_device_id option_ids[] = {
297 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, 301 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) },
298 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, 302 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
299 { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) }, 303 { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) },
304 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MSA501HS) },
300 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) }, 305 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) },
301 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, 306 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) },
302 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, 307 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) },
303 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, 308 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) },
309 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */
304 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ 310 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
305 { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ 311 { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */
306 { USB_DEVICE(0x19d2, 0x0001) }, /* Telstra NextG CDMA */ 312 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) },
307 { } /* Terminating entry */ 313 { } /* Terminating entry */
308}; 314};
309MODULE_DEVICE_TABLE(usb, option_ids); 315MODULE_DEVICE_TABLE(usb, option_ids);
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index c605fb68f807..2a0dd1b50dc4 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -56,6 +56,8 @@ static struct usb_device_id id_table [] = {
56 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ3) }, 56 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ3) },
57 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_PHAROS) }, 57 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_PHAROS) },
58 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) }, 58 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) },
59 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) },
60 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) },
59 { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, 61 { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) },
60 { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, 62 { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) },
61 { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, 63 { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) },
@@ -66,7 +68,6 @@ static struct usb_device_id id_table [] = {
66 { USB_DEVICE(ITEGNO_VENDOR_ID, ITEGNO_PRODUCT_ID_2080) }, 68 { USB_DEVICE(ITEGNO_VENDOR_ID, ITEGNO_PRODUCT_ID_2080) },
67 { USB_DEVICE(MA620_VENDOR_ID, MA620_PRODUCT_ID) }, 69 { USB_DEVICE(MA620_VENDOR_ID, MA620_PRODUCT_ID) },
68 { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID) }, 70 { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID) },
69 { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
70 { USB_DEVICE(TRIPP_VENDOR_ID, TRIPP_PRODUCT_ID) }, 71 { USB_DEVICE(TRIPP_VENDOR_ID, TRIPP_PRODUCT_ID) },
71 { USB_DEVICE(RADIOSHACK_VENDOR_ID, RADIOSHACK_PRODUCT_ID) }, 72 { USB_DEVICE(RADIOSHACK_VENDOR_ID, RADIOSHACK_PRODUCT_ID) },
72 { USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) }, 73 { USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) },
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
index 10cf872e5ecb..6ac3bbcf7a22 100644
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -14,6 +14,8 @@
14#define PL2303_PRODUCT_ID_PHAROS 0xaaa0 14#define PL2303_PRODUCT_ID_PHAROS 0xaaa0
15#define PL2303_PRODUCT_ID_RSAQ3 0xaaa2 15#define PL2303_PRODUCT_ID_RSAQ3 0xaaa2
16#define PL2303_PRODUCT_ID_ALDIGA 0x0611 16#define PL2303_PRODUCT_ID_ALDIGA 0x0611
17#define PL2303_PRODUCT_ID_MMX 0x0612
18#define PL2303_PRODUCT_ID_GPRS 0x0609
17 19
18#define ATEN_VENDOR_ID 0x0557 20#define ATEN_VENDOR_ID 0x0557
19#define ATEN_VENDOR_ID2 0x0547 21#define ATEN_VENDOR_ID2 0x0547
@@ -36,7 +38,6 @@
36 38
37#define RATOC_VENDOR_ID 0x0584 39#define RATOC_VENDOR_ID 0x0584
38#define RATOC_PRODUCT_ID 0xb000 40#define RATOC_PRODUCT_ID 0xb000
39#define RATOC_PRODUCT_ID_USB60F 0xb020
40 41
41#define TRIPP_VENDOR_ID 0x2478 42#define TRIPP_VENDOR_ID 0x2478
42#define TRIPP_PRODUCT_ID 0x2008 43#define TRIPP_PRODUCT_ID 0x2008
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 1b09578cbb10..39a7c11795c4 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -402,10 +402,18 @@ UNUSUAL_DEV( 0x04a5, 0x3010, 0x0100, 0x0100,
402 US_FL_IGNORE_RESIDUE ), 402 US_FL_IGNORE_RESIDUE ),
403 403
404#ifdef CONFIG_USB_STORAGE_CYPRESS_ATACB 404#ifdef CONFIG_USB_STORAGE_CYPRESS_ATACB
405/* CY7C68300 : support atacb */
405UNUSUAL_DEV( 0x04b4, 0x6830, 0x0000, 0x9999, 406UNUSUAL_DEV( 0x04b4, 0x6830, 0x0000, 0x9999,
406 "Cypress", 407 "Cypress",
407 "Cypress AT2LP", 408 "Cypress AT2LP",
408 US_SC_CYP_ATACB, US_PR_BULK, NULL, 409 US_SC_CYP_ATACB, US_PR_DEVICE, NULL,
410 0),
411
412/* CY7C68310 : support atacb and atacb2 */
413UNUSUAL_DEV( 0x04b4, 0x6831, 0x0000, 0x9999,
414 "Cypress",
415 "Cypress ISD-300LP",
416 US_SC_CYP_ATACB, US_PR_DEVICE, NULL,
409 0), 417 0),
410#endif 418#endif
411 419
@@ -1522,7 +1530,7 @@ UNUSUAL_DEV( 0x0fce, 0xe031, 0x0000, 0x0000,
1522 "Sony Ericsson", 1530 "Sony Ericsson",
1523 "M600i", 1531 "M600i",
1524 US_SC_DEVICE, US_PR_DEVICE, NULL, 1532 US_SC_DEVICE, US_PR_DEVICE, NULL,
1525 US_FL_FIX_CAPACITY ), 1533 US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ),
1526 1534
1527/* Reported by Kevin Cernekee <kpc-usbdev@gelato.uiuc.edu> 1535/* Reported by Kevin Cernekee <kpc-usbdev@gelato.uiuc.edu>
1528 * Tested on hardware version 1.10. 1536 * Tested on hardware version 1.10.
@@ -1716,10 +1724,12 @@ UNUSUAL_DEV( 0x22b8, 0x3010, 0x0001, 0x0001,
1716/* 1724/*
1717 * Patch by Pete Zaitcev <zaitcev@redhat.com> 1725 * Patch by Pete Zaitcev <zaitcev@redhat.com>
1718 * Report by Mark Patton. Red Hat bz#208928. 1726 * Report by Mark Patton. Red Hat bz#208928.
1727 * Added support for rev 0x0002 (Motorola ROKR W5)
1728 * by Javier Smaldone <javier@smaldone.com.ar>
1719 */ 1729 */
1720UNUSUAL_DEV( 0x22b8, 0x4810, 0x0001, 0x0001, 1730UNUSUAL_DEV( 0x22b8, 0x4810, 0x0001, 0x0002,
1721 "Motorola", 1731 "Motorola",
1722 "RAZR V3i", 1732 "RAZR V3i/ROKR W5",
1723 US_SC_DEVICE, US_PR_DEVICE, NULL, 1733 US_SC_DEVICE, US_PR_DEVICE, NULL,
1724 US_FL_FIX_CAPACITY), 1734 US_FL_FIX_CAPACITY),
1725 1735