diff options
Diffstat (limited to 'drivers/usb')
158 files changed, 793 insertions, 283 deletions
diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c index 3e862401a638..1e9ba4bdffef 100644 --- a/drivers/usb/atm/speedtch.c +++ b/drivers/usb/atm/speedtch.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/device.h> | 27 | #include <linux/device.h> |
28 | #include <linux/errno.h> | 28 | #include <linux/errno.h> |
29 | #include <linux/firmware.h> | 29 | #include <linux/firmware.h> |
30 | #include <linux/gfp.h> | ||
31 | #include <linux/init.h> | 30 | #include <linux/init.h> |
32 | #include <linux/kernel.h> | 31 | #include <linux/kernel.h> |
33 | #include <linux/module.h> | 32 | #include <linux/module.h> |
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index c5395246886d..25f01b536f67 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c | |||
@@ -66,6 +66,7 @@ | |||
66 | #include <linux/kthread.h> | 66 | #include <linux/kthread.h> |
67 | #include <linux/mutex.h> | 67 | #include <linux/mutex.h> |
68 | #include <linux/freezer.h> | 68 | #include <linux/freezer.h> |
69 | #include <linux/slab.h> | ||
69 | 70 | ||
70 | #include <asm/unaligned.h> | 71 | #include <asm/unaligned.h> |
71 | 72 | ||
diff --git a/drivers/usb/c67x00/c67x00-drv.c b/drivers/usb/c67x00/c67x00-drv.c index 029ee4a8a1f3..b6d49234e521 100644 --- a/drivers/usb/c67x00/c67x00-drv.c +++ b/drivers/usb/c67x00/c67x00-drv.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/device.h> | 37 | #include <linux/device.h> |
38 | #include <linux/io.h> | 38 | #include <linux/io.h> |
39 | #include <linux/list.h> | 39 | #include <linux/list.h> |
40 | #include <linux/slab.h> | ||
40 | #include <linux/usb.h> | 41 | #include <linux/usb.h> |
41 | #include <linux/usb/c67x00.h> | 42 | #include <linux/usb/c67x00.h> |
42 | 43 | ||
diff --git a/drivers/usb/c67x00/c67x00-sched.c b/drivers/usb/c67x00/c67x00-sched.c index 85dfe2965661..f6b3c253f3fa 100644 --- a/drivers/usb/c67x00/c67x00-sched.c +++ b/drivers/usb/c67x00/c67x00-sched.c | |||
@@ -22,6 +22,7 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <linux/kthread.h> | 24 | #include <linux/kthread.h> |
25 | #include <linux/slab.h> | ||
25 | 26 | ||
26 | #include "c67x00.h" | 27 | #include "c67x00.h" |
27 | #include "c67x00-hcd.h" | 28 | #include "c67x00-hcd.h" |
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 975d556b4787..5e1a253b08a0 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -1441,7 +1441,7 @@ static int acm_resume(struct usb_interface *intf) | |||
1441 | wb = acm->delayed_wb; | 1441 | wb = acm->delayed_wb; |
1442 | acm->delayed_wb = NULL; | 1442 | acm->delayed_wb = NULL; |
1443 | spin_unlock_irq(&acm->write_lock); | 1443 | spin_unlock_irq(&acm->write_lock); |
1444 | acm_start_wb(acm, acm->delayed_wb); | 1444 | acm_start_wb(acm, wb); |
1445 | } else { | 1445 | } else { |
1446 | spin_unlock_irq(&acm->write_lock); | 1446 | spin_unlock_irq(&acm->write_lock); |
1447 | } | 1447 | } |
@@ -1542,6 +1542,9 @@ static const struct usb_device_id acm_ids[] = { | |||
1542 | { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */ | 1542 | { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */ |
1543 | .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ | 1543 | .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ |
1544 | }, | 1544 | }, |
1545 | { USB_DEVICE(0x1576, 0x03b1), /* Maretron USB100 */ | ||
1546 | .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ | ||
1547 | }, | ||
1545 | 1548 | ||
1546 | /* Nokia S60 phones expose two ACM channels. The first is | 1549 | /* Nokia S60 phones expose two ACM channels. The first is |
1547 | * a modem and is picked up by the standard AT-command | 1550 | * a modem and is picked up by the standard AT-command |
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 18aafcb08fc8..189141ca4e05 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -52,7 +52,8 @@ MODULE_DEVICE_TABLE (usb, wdm_ids); | |||
52 | #define WDM_READ 4 | 52 | #define WDM_READ 4 |
53 | #define WDM_INT_STALL 5 | 53 | #define WDM_INT_STALL 5 |
54 | #define WDM_POLL_RUNNING 6 | 54 | #define WDM_POLL_RUNNING 6 |
55 | 55 | #define WDM_RESPONDING 7 | |
56 | #define WDM_SUSPENDING 8 | ||
56 | 57 | ||
57 | #define WDM_MAX 16 | 58 | #define WDM_MAX 16 |
58 | 59 | ||
@@ -87,9 +88,7 @@ struct wdm_device { | |||
87 | int count; | 88 | int count; |
88 | dma_addr_t shandle; | 89 | dma_addr_t shandle; |
89 | dma_addr_t ihandle; | 90 | dma_addr_t ihandle; |
90 | struct mutex wlock; | 91 | struct mutex lock; |
91 | struct mutex rlock; | ||
92 | struct mutex plock; | ||
93 | wait_queue_head_t wait; | 92 | wait_queue_head_t wait; |
94 | struct work_struct rxwork; | 93 | struct work_struct rxwork; |
95 | int werr; | 94 | int werr; |
@@ -117,21 +116,22 @@ static void wdm_in_callback(struct urb *urb) | |||
117 | int status = urb->status; | 116 | int status = urb->status; |
118 | 117 | ||
119 | spin_lock(&desc->iuspin); | 118 | spin_lock(&desc->iuspin); |
119 | clear_bit(WDM_RESPONDING, &desc->flags); | ||
120 | 120 | ||
121 | if (status) { | 121 | if (status) { |
122 | switch (status) { | 122 | switch (status) { |
123 | case -ENOENT: | 123 | case -ENOENT: |
124 | dev_dbg(&desc->intf->dev, | 124 | dev_dbg(&desc->intf->dev, |
125 | "nonzero urb status received: -ENOENT"); | 125 | "nonzero urb status received: -ENOENT"); |
126 | break; | 126 | goto skip_error; |
127 | case -ECONNRESET: | 127 | case -ECONNRESET: |
128 | dev_dbg(&desc->intf->dev, | 128 | dev_dbg(&desc->intf->dev, |
129 | "nonzero urb status received: -ECONNRESET"); | 129 | "nonzero urb status received: -ECONNRESET"); |
130 | break; | 130 | goto skip_error; |
131 | case -ESHUTDOWN: | 131 | case -ESHUTDOWN: |
132 | dev_dbg(&desc->intf->dev, | 132 | dev_dbg(&desc->intf->dev, |
133 | "nonzero urb status received: -ESHUTDOWN"); | 133 | "nonzero urb status received: -ESHUTDOWN"); |
134 | break; | 134 | goto skip_error; |
135 | case -EPIPE: | 135 | case -EPIPE: |
136 | dev_err(&desc->intf->dev, | 136 | dev_err(&desc->intf->dev, |
137 | "nonzero urb status received: -EPIPE\n"); | 137 | "nonzero urb status received: -EPIPE\n"); |
@@ -147,6 +147,7 @@ static void wdm_in_callback(struct urb *urb) | |||
147 | desc->reslength = urb->actual_length; | 147 | desc->reslength = urb->actual_length; |
148 | memmove(desc->ubuf + desc->length, desc->inbuf, desc->reslength); | 148 | memmove(desc->ubuf + desc->length, desc->inbuf, desc->reslength); |
149 | desc->length += desc->reslength; | 149 | desc->length += desc->reslength; |
150 | skip_error: | ||
150 | wake_up(&desc->wait); | 151 | wake_up(&desc->wait); |
151 | 152 | ||
152 | set_bit(WDM_READ, &desc->flags); | 153 | set_bit(WDM_READ, &desc->flags); |
@@ -229,13 +230,16 @@ static void wdm_int_callback(struct urb *urb) | |||
229 | desc->response->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | 230 | desc->response->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
230 | spin_lock(&desc->iuspin); | 231 | spin_lock(&desc->iuspin); |
231 | clear_bit(WDM_READ, &desc->flags); | 232 | clear_bit(WDM_READ, &desc->flags); |
232 | if (!test_bit(WDM_DISCONNECTING, &desc->flags)) { | 233 | set_bit(WDM_RESPONDING, &desc->flags); |
234 | if (!test_bit(WDM_DISCONNECTING, &desc->flags) | ||
235 | && !test_bit(WDM_SUSPENDING, &desc->flags)) { | ||
233 | rv = usb_submit_urb(desc->response, GFP_ATOMIC); | 236 | rv = usb_submit_urb(desc->response, GFP_ATOMIC); |
234 | dev_dbg(&desc->intf->dev, "%s: usb_submit_urb %d", | 237 | dev_dbg(&desc->intf->dev, "%s: usb_submit_urb %d", |
235 | __func__, rv); | 238 | __func__, rv); |
236 | } | 239 | } |
237 | spin_unlock(&desc->iuspin); | 240 | spin_unlock(&desc->iuspin); |
238 | if (rv < 0) { | 241 | if (rv < 0) { |
242 | clear_bit(WDM_RESPONDING, &desc->flags); | ||
239 | if (rv == -EPERM) | 243 | if (rv == -EPERM) |
240 | return; | 244 | return; |
241 | if (rv == -ENOMEM) { | 245 | if (rv == -ENOMEM) { |
@@ -305,14 +309,38 @@ static ssize_t wdm_write | |||
305 | if (we < 0) | 309 | if (we < 0) |
306 | return -EIO; | 310 | return -EIO; |
307 | 311 | ||
308 | r = mutex_lock_interruptible(&desc->wlock); /* concurrent writes */ | 312 | desc->outbuf = buf = kmalloc(count, GFP_KERNEL); |
313 | if (!buf) { | ||
314 | rv = -ENOMEM; | ||
315 | goto outnl; | ||
316 | } | ||
317 | |||
318 | r = copy_from_user(buf, buffer, count); | ||
319 | if (r > 0) { | ||
320 | kfree(buf); | ||
321 | rv = -EFAULT; | ||
322 | goto outnl; | ||
323 | } | ||
324 | |||
325 | /* concurrent writes and disconnect */ | ||
326 | r = mutex_lock_interruptible(&desc->lock); | ||
309 | rv = -ERESTARTSYS; | 327 | rv = -ERESTARTSYS; |
310 | if (r) | 328 | if (r) { |
329 | kfree(buf); | ||
311 | goto outnl; | 330 | goto outnl; |
331 | } | ||
332 | |||
333 | if (test_bit(WDM_DISCONNECTING, &desc->flags)) { | ||
334 | kfree(buf); | ||
335 | rv = -ENODEV; | ||
336 | goto outnp; | ||
337 | } | ||
312 | 338 | ||
313 | r = usb_autopm_get_interface(desc->intf); | 339 | r = usb_autopm_get_interface(desc->intf); |
314 | if (r < 0) | 340 | if (r < 0) { |
341 | kfree(buf); | ||
315 | goto outnp; | 342 | goto outnp; |
343 | } | ||
316 | 344 | ||
317 | if (!file->f_flags && O_NONBLOCK) | 345 | if (!file->f_flags && O_NONBLOCK) |
318 | r = wait_event_interruptible(desc->wait, !test_bit(WDM_IN_USE, | 346 | r = wait_event_interruptible(desc->wait, !test_bit(WDM_IN_USE, |
@@ -320,24 +348,8 @@ static ssize_t wdm_write | |||
320 | else | 348 | else |
321 | if (test_bit(WDM_IN_USE, &desc->flags)) | 349 | if (test_bit(WDM_IN_USE, &desc->flags)) |
322 | r = -EAGAIN; | 350 | r = -EAGAIN; |
323 | if (r < 0) | 351 | if (r < 0) { |
324 | goto out; | ||
325 | |||
326 | if (test_bit(WDM_DISCONNECTING, &desc->flags)) { | ||
327 | rv = -ENODEV; | ||
328 | goto out; | ||
329 | } | ||
330 | |||
331 | desc->outbuf = buf = kmalloc(count, GFP_KERNEL); | ||
332 | if (!buf) { | ||
333 | rv = -ENOMEM; | ||
334 | goto out; | ||
335 | } | ||
336 | |||
337 | r = copy_from_user(buf, buffer, count); | ||
338 | if (r > 0) { | ||
339 | kfree(buf); | 352 | kfree(buf); |
340 | rv = -EFAULT; | ||
341 | goto out; | 353 | goto out; |
342 | } | 354 | } |
343 | 355 | ||
@@ -374,7 +386,7 @@ static ssize_t wdm_write | |||
374 | out: | 386 | out: |
375 | usb_autopm_put_interface(desc->intf); | 387 | usb_autopm_put_interface(desc->intf); |
376 | outnp: | 388 | outnp: |
377 | mutex_unlock(&desc->wlock); | 389 | mutex_unlock(&desc->lock); |
378 | outnl: | 390 | outnl: |
379 | return rv < 0 ? rv : count; | 391 | return rv < 0 ? rv : count; |
380 | } | 392 | } |
@@ -387,7 +399,7 @@ static ssize_t wdm_read | |||
387 | struct wdm_device *desc = file->private_data; | 399 | struct wdm_device *desc = file->private_data; |
388 | 400 | ||
389 | 401 | ||
390 | rv = mutex_lock_interruptible(&desc->rlock); /*concurrent reads */ | 402 | rv = mutex_lock_interruptible(&desc->lock); /*concurrent reads */ |
391 | if (rv < 0) | 403 | if (rv < 0) |
392 | return -ERESTARTSYS; | 404 | return -ERESTARTSYS; |
393 | 405 | ||
@@ -424,11 +436,8 @@ retry: | |||
424 | spin_lock_irq(&desc->iuspin); | 436 | spin_lock_irq(&desc->iuspin); |
425 | 437 | ||
426 | if (desc->rerr) { /* read completed, error happened */ | 438 | if (desc->rerr) { /* read completed, error happened */ |
427 | int t = desc->rerr; | ||
428 | desc->rerr = 0; | 439 | desc->rerr = 0; |
429 | spin_unlock_irq(&desc->iuspin); | 440 | spin_unlock_irq(&desc->iuspin); |
430 | dev_err(&desc->intf->dev, | ||
431 | "reading had resulted in %d\n", t); | ||
432 | rv = -EIO; | 441 | rv = -EIO; |
433 | goto err; | 442 | goto err; |
434 | } | 443 | } |
@@ -465,9 +474,7 @@ retry: | |||
465 | rv = cntr; | 474 | rv = cntr; |
466 | 475 | ||
467 | err: | 476 | err: |
468 | mutex_unlock(&desc->rlock); | 477 | mutex_unlock(&desc->lock); |
469 | if (rv < 0 && rv != -EAGAIN) | ||
470 | dev_err(&desc->intf->dev, "wdm_read: exit error\n"); | ||
471 | return rv; | 478 | return rv; |
472 | } | 479 | } |
473 | 480 | ||
@@ -533,7 +540,7 @@ static int wdm_open(struct inode *inode, struct file *file) | |||
533 | } | 540 | } |
534 | intf->needs_remote_wakeup = 1; | 541 | intf->needs_remote_wakeup = 1; |
535 | 542 | ||
536 | mutex_lock(&desc->plock); | 543 | mutex_lock(&desc->lock); |
537 | if (!desc->count++) { | 544 | if (!desc->count++) { |
538 | rv = usb_submit_urb(desc->validity, GFP_KERNEL); | 545 | rv = usb_submit_urb(desc->validity, GFP_KERNEL); |
539 | if (rv < 0) { | 546 | if (rv < 0) { |
@@ -544,7 +551,7 @@ static int wdm_open(struct inode *inode, struct file *file) | |||
544 | } else { | 551 | } else { |
545 | rv = 0; | 552 | rv = 0; |
546 | } | 553 | } |
547 | mutex_unlock(&desc->plock); | 554 | mutex_unlock(&desc->lock); |
548 | usb_autopm_put_interface(desc->intf); | 555 | usb_autopm_put_interface(desc->intf); |
549 | out: | 556 | out: |
550 | mutex_unlock(&wdm_mutex); | 557 | mutex_unlock(&wdm_mutex); |
@@ -556,9 +563,9 @@ static int wdm_release(struct inode *inode, struct file *file) | |||
556 | struct wdm_device *desc = file->private_data; | 563 | struct wdm_device *desc = file->private_data; |
557 | 564 | ||
558 | mutex_lock(&wdm_mutex); | 565 | mutex_lock(&wdm_mutex); |
559 | mutex_lock(&desc->plock); | 566 | mutex_lock(&desc->lock); |
560 | desc->count--; | 567 | desc->count--; |
561 | mutex_unlock(&desc->plock); | 568 | mutex_unlock(&desc->lock); |
562 | 569 | ||
563 | if (!desc->count) { | 570 | if (!desc->count) { |
564 | dev_dbg(&desc->intf->dev, "wdm_release: cleanup"); | 571 | dev_dbg(&desc->intf->dev, "wdm_release: cleanup"); |
@@ -655,9 +662,7 @@ next_desc: | |||
655 | desc = kzalloc(sizeof(struct wdm_device), GFP_KERNEL); | 662 | desc = kzalloc(sizeof(struct wdm_device), GFP_KERNEL); |
656 | if (!desc) | 663 | if (!desc) |
657 | goto out; | 664 | goto out; |
658 | mutex_init(&desc->wlock); | 665 | mutex_init(&desc->lock); |
659 | mutex_init(&desc->rlock); | ||
660 | mutex_init(&desc->plock); | ||
661 | spin_lock_init(&desc->iuspin); | 666 | spin_lock_init(&desc->iuspin); |
662 | init_waitqueue_head(&desc->wait); | 667 | init_waitqueue_head(&desc->wait); |
663 | desc->wMaxCommand = maxcom; | 668 | desc->wMaxCommand = maxcom; |
@@ -771,14 +776,17 @@ static void wdm_disconnect(struct usb_interface *intf) | |||
771 | /* to terminate pending flushes */ | 776 | /* to terminate pending flushes */ |
772 | clear_bit(WDM_IN_USE, &desc->flags); | 777 | clear_bit(WDM_IN_USE, &desc->flags); |
773 | spin_unlock_irqrestore(&desc->iuspin, flags); | 778 | spin_unlock_irqrestore(&desc->iuspin, flags); |
774 | cancel_work_sync(&desc->rxwork); | 779 | mutex_lock(&desc->lock); |
775 | kill_urbs(desc); | 780 | kill_urbs(desc); |
781 | cancel_work_sync(&desc->rxwork); | ||
782 | mutex_unlock(&desc->lock); | ||
776 | wake_up_all(&desc->wait); | 783 | wake_up_all(&desc->wait); |
777 | if (!desc->count) | 784 | if (!desc->count) |
778 | cleanup(desc); | 785 | cleanup(desc); |
779 | mutex_unlock(&wdm_mutex); | 786 | mutex_unlock(&wdm_mutex); |
780 | } | 787 | } |
781 | 788 | ||
789 | #ifdef CONFIG_PM | ||
782 | static int wdm_suspend(struct usb_interface *intf, pm_message_t message) | 790 | static int wdm_suspend(struct usb_interface *intf, pm_message_t message) |
783 | { | 791 | { |
784 | struct wdm_device *desc = usb_get_intfdata(intf); | 792 | struct wdm_device *desc = usb_get_intfdata(intf); |
@@ -786,22 +794,30 @@ static int wdm_suspend(struct usb_interface *intf, pm_message_t message) | |||
786 | 794 | ||
787 | dev_dbg(&desc->intf->dev, "wdm%d_suspend\n", intf->minor); | 795 | dev_dbg(&desc->intf->dev, "wdm%d_suspend\n", intf->minor); |
788 | 796 | ||
789 | mutex_lock(&desc->plock); | 797 | /* if this is an autosuspend the caller does the locking */ |
790 | #ifdef CONFIG_PM | 798 | if (!(message.event & PM_EVENT_AUTO)) |
799 | mutex_lock(&desc->lock); | ||
800 | spin_lock_irq(&desc->iuspin); | ||
801 | |||
791 | if ((message.event & PM_EVENT_AUTO) && | 802 | if ((message.event & PM_EVENT_AUTO) && |
792 | test_bit(WDM_IN_USE, &desc->flags)) { | 803 | (test_bit(WDM_IN_USE, &desc->flags) |
804 | || test_bit(WDM_RESPONDING, &desc->flags))) { | ||
805 | spin_unlock_irq(&desc->iuspin); | ||
793 | rv = -EBUSY; | 806 | rv = -EBUSY; |
794 | } else { | 807 | } else { |
795 | #endif | 808 | |
796 | cancel_work_sync(&desc->rxwork); | 809 | set_bit(WDM_SUSPENDING, &desc->flags); |
810 | spin_unlock_irq(&desc->iuspin); | ||
811 | /* callback submits work - order is essential */ | ||
797 | kill_urbs(desc); | 812 | kill_urbs(desc); |
798 | #ifdef CONFIG_PM | 813 | cancel_work_sync(&desc->rxwork); |
799 | } | 814 | } |
800 | #endif | 815 | if (!(message.event & PM_EVENT_AUTO)) |
801 | mutex_unlock(&desc->plock); | 816 | mutex_unlock(&desc->lock); |
802 | 817 | ||
803 | return rv; | 818 | return rv; |
804 | } | 819 | } |
820 | #endif | ||
805 | 821 | ||
806 | static int recover_from_urb_loss(struct wdm_device *desc) | 822 | static int recover_from_urb_loss(struct wdm_device *desc) |
807 | { | 823 | { |
@@ -815,23 +831,27 @@ static int recover_from_urb_loss(struct wdm_device *desc) | |||
815 | } | 831 | } |
816 | return rv; | 832 | return rv; |
817 | } | 833 | } |
834 | |||
835 | #ifdef CONFIG_PM | ||
818 | static int wdm_resume(struct usb_interface *intf) | 836 | static int wdm_resume(struct usb_interface *intf) |
819 | { | 837 | { |
820 | struct wdm_device *desc = usb_get_intfdata(intf); | 838 | struct wdm_device *desc = usb_get_intfdata(intf); |
821 | int rv; | 839 | int rv; |
822 | 840 | ||
823 | dev_dbg(&desc->intf->dev, "wdm%d_resume\n", intf->minor); | 841 | dev_dbg(&desc->intf->dev, "wdm%d_resume\n", intf->minor); |
824 | mutex_lock(&desc->plock); | 842 | |
843 | clear_bit(WDM_SUSPENDING, &desc->flags); | ||
825 | rv = recover_from_urb_loss(desc); | 844 | rv = recover_from_urb_loss(desc); |
826 | mutex_unlock(&desc->plock); | 845 | |
827 | return rv; | 846 | return rv; |
828 | } | 847 | } |
848 | #endif | ||
829 | 849 | ||
830 | static int wdm_pre_reset(struct usb_interface *intf) | 850 | static int wdm_pre_reset(struct usb_interface *intf) |
831 | { | 851 | { |
832 | struct wdm_device *desc = usb_get_intfdata(intf); | 852 | struct wdm_device *desc = usb_get_intfdata(intf); |
833 | 853 | ||
834 | mutex_lock(&desc->plock); | 854 | mutex_lock(&desc->lock); |
835 | return 0; | 855 | return 0; |
836 | } | 856 | } |
837 | 857 | ||
@@ -841,7 +861,7 @@ static int wdm_post_reset(struct usb_interface *intf) | |||
841 | int rv; | 861 | int rv; |
842 | 862 | ||
843 | rv = recover_from_urb_loss(desc); | 863 | rv = recover_from_urb_loss(desc); |
844 | mutex_unlock(&desc->plock); | 864 | mutex_unlock(&desc->lock); |
845 | return 0; | 865 | return 0; |
846 | } | 866 | } |
847 | 867 | ||
@@ -849,9 +869,11 @@ static struct usb_driver wdm_driver = { | |||
849 | .name = "cdc_wdm", | 869 | .name = "cdc_wdm", |
850 | .probe = wdm_probe, | 870 | .probe = wdm_probe, |
851 | .disconnect = wdm_disconnect, | 871 | .disconnect = wdm_disconnect, |
872 | #ifdef CONFIG_PM | ||
852 | .suspend = wdm_suspend, | 873 | .suspend = wdm_suspend, |
853 | .resume = wdm_resume, | 874 | .resume = wdm_resume, |
854 | .reset_resume = wdm_resume, | 875 | .reset_resume = wdm_resume, |
876 | #endif | ||
855 | .pre_reset = wdm_pre_reset, | 877 | .pre_reset = wdm_pre_reset, |
856 | .post_reset = wdm_post_reset, | 878 | .post_reset = wdm_post_reset, |
857 | .id_table = wdm_ids, | 879 | .id_table = wdm_ids, |
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 8588c0937a89..3e7c1b800ebb 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/fs.h> | 25 | #include <linux/fs.h> |
26 | #include <linux/uaccess.h> | 26 | #include <linux/uaccess.h> |
27 | #include <linux/kref.h> | 27 | #include <linux/kref.h> |
28 | #include <linux/slab.h> | ||
28 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
29 | #include <linux/usb.h> | 30 | #include <linux/usb.h> |
30 | #include <linux/usb/tmc.h> | 31 | #include <linux/usb/tmc.h> |
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig index 97a819c23ef3..7e594449600e 100644 --- a/drivers/usb/core/Kconfig +++ b/drivers/usb/core/Kconfig | |||
@@ -109,7 +109,7 @@ config USB_SUSPEND | |||
109 | config USB_OTG | 109 | config USB_OTG |
110 | bool | 110 | bool |
111 | depends on USB && EXPERIMENTAL | 111 | depends on USB && EXPERIMENTAL |
112 | select USB_SUSPEND | 112 | depends on USB_SUSPEND |
113 | default n | 113 | default n |
114 | 114 | ||
115 | 115 | ||
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c index d41811bfef2a..19bc03a9fecf 100644 --- a/drivers/usb/core/devices.c +++ b/drivers/usb/core/devices.c | |||
@@ -50,7 +50,7 @@ | |||
50 | 50 | ||
51 | #include <linux/fs.h> | 51 | #include <linux/fs.h> |
52 | #include <linux/mm.h> | 52 | #include <linux/mm.h> |
53 | #include <linux/slab.h> | 53 | #include <linux/gfp.h> |
54 | #include <linux/poll.h> | 54 | #include <linux/poll.h> |
55 | #include <linux/usb.h> | 55 | #include <linux/usb.h> |
56 | #include <linux/smp_lock.h> | 56 | #include <linux/smp_lock.h> |
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index e909ff7b9094..3466fdc5bb11 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -1207,6 +1207,13 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, | |||
1207 | free_async(as); | 1207 | free_async(as); |
1208 | return -ENOMEM; | 1208 | return -ENOMEM; |
1209 | } | 1209 | } |
1210 | /* Isochronous input data may end up being discontiguous | ||
1211 | * if some of the packets are short. Clear the buffer so | ||
1212 | * that the gaps don't leak kernel data to userspace. | ||
1213 | */ | ||
1214 | if (is_in && uurb->type == USBDEVFS_URB_TYPE_ISO) | ||
1215 | memset(as->urb->transfer_buffer, 0, | ||
1216 | uurb->buffer_length); | ||
1210 | } | 1217 | } |
1211 | as->urb->dev = ps->dev; | 1218 | as->urb->dev = ps->dev; |
1212 | as->urb->pipe = (uurb->type << 30) | | 1219 | as->urb->pipe = (uurb->type << 30) | |
@@ -1345,10 +1352,14 @@ static int processcompl(struct async *as, void __user * __user *arg) | |||
1345 | void __user *addr = as->userurb; | 1352 | void __user *addr = as->userurb; |
1346 | unsigned int i; | 1353 | unsigned int i; |
1347 | 1354 | ||
1348 | if (as->userbuffer && urb->actual_length) | 1355 | if (as->userbuffer && urb->actual_length) { |
1349 | if (copy_to_user(as->userbuffer, urb->transfer_buffer, | 1356 | if (urb->number_of_packets > 0) /* Isochronous */ |
1350 | urb->actual_length)) | 1357 | i = urb->transfer_buffer_length; |
1358 | else /* Non-Isoc */ | ||
1359 | i = urb->actual_length; | ||
1360 | if (copy_to_user(as->userbuffer, urb->transfer_buffer, i)) | ||
1351 | goto err_out; | 1361 | goto err_out; |
1362 | } | ||
1352 | if (put_user(as->status, &userurb->status)) | 1363 | if (put_user(as->status, &userurb->status)) |
1353 | goto err_out; | 1364 | goto err_out; |
1354 | if (put_user(urb->actual_length, &userurb->actual_length)) | 1365 | if (put_user(urb->actual_length, &userurb->actual_length)) |
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index f3c233806fa3..2f3dc4cdf79b 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -23,6 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <linux/device.h> | 25 | #include <linux/device.h> |
26 | #include <linux/slab.h> | ||
26 | #include <linux/usb.h> | 27 | #include <linux/usb.h> |
27 | #include <linux/usb/quirks.h> | 28 | #include <linux/usb/quirks.h> |
28 | #include <linux/pm_runtime.h> | 29 | #include <linux/pm_runtime.h> |
@@ -300,7 +301,7 @@ static int usb_probe_interface(struct device *dev) | |||
300 | 301 | ||
301 | intf->condition = USB_INTERFACE_BINDING; | 302 | intf->condition = USB_INTERFACE_BINDING; |
302 | 303 | ||
303 | /* Bound interfaces are initially active. They are | 304 | /* Probed interfaces are initially active. They are |
304 | * runtime-PM-enabled only if the driver has autosuspend support. | 305 | * runtime-PM-enabled only if the driver has autosuspend support. |
305 | * They are sensitive to their children's power states. | 306 | * They are sensitive to their children's power states. |
306 | */ | 307 | */ |
@@ -436,11 +437,11 @@ int usb_driver_claim_interface(struct usb_driver *driver, | |||
436 | 437 | ||
437 | iface->condition = USB_INTERFACE_BOUND; | 438 | iface->condition = USB_INTERFACE_BOUND; |
438 | 439 | ||
439 | /* Bound interfaces are initially active. They are | 440 | /* Claimed interfaces are initially inactive (suspended). They are |
440 | * runtime-PM-enabled only if the driver has autosuspend support. | 441 | * runtime-PM-enabled only if the driver has autosuspend support. |
441 | * They are sensitive to their children's power states. | 442 | * They are sensitive to their children's power states. |
442 | */ | 443 | */ |
443 | pm_runtime_set_active(dev); | 444 | pm_runtime_set_suspended(dev); |
444 | pm_suspend_ignore_children(dev, false); | 445 | pm_suspend_ignore_children(dev, false); |
445 | if (driver->supports_autosuspend) | 446 | if (driver->supports_autosuspend) |
446 | pm_runtime_enable(dev); | 447 | pm_runtime_enable(dev); |
@@ -1169,7 +1170,7 @@ done: | |||
1169 | static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | 1170 | static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) |
1170 | { | 1171 | { |
1171 | int status = 0; | 1172 | int status = 0; |
1172 | int i = 0; | 1173 | int i = 0, n = 0; |
1173 | struct usb_interface *intf; | 1174 | struct usb_interface *intf; |
1174 | 1175 | ||
1175 | if (udev->state == USB_STATE_NOTATTACHED || | 1176 | if (udev->state == USB_STATE_NOTATTACHED || |
@@ -1178,7 +1179,8 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | |||
1178 | 1179 | ||
1179 | /* Suspend all the interfaces and then udev itself */ | 1180 | /* Suspend all the interfaces and then udev itself */ |
1180 | if (udev->actconfig) { | 1181 | if (udev->actconfig) { |
1181 | for (; i < udev->actconfig->desc.bNumInterfaces; i++) { | 1182 | n = udev->actconfig->desc.bNumInterfaces; |
1183 | for (i = n - 1; i >= 0; --i) { | ||
1182 | intf = udev->actconfig->interface[i]; | 1184 | intf = udev->actconfig->interface[i]; |
1183 | status = usb_suspend_interface(udev, intf, msg); | 1185 | status = usb_suspend_interface(udev, intf, msg); |
1184 | if (status != 0) | 1186 | if (status != 0) |
@@ -1191,7 +1193,7 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | |||
1191 | /* If the suspend failed, resume interfaces that did get suspended */ | 1193 | /* If the suspend failed, resume interfaces that did get suspended */ |
1192 | if (status != 0) { | 1194 | if (status != 0) { |
1193 | msg.event ^= (PM_EVENT_SUSPEND | PM_EVENT_RESUME); | 1195 | msg.event ^= (PM_EVENT_SUSPEND | PM_EVENT_RESUME); |
1194 | while (--i >= 0) { | 1196 | while (++i < n) { |
1195 | intf = udev->actconfig->interface[i]; | 1197 | intf = udev->actconfig->interface[i]; |
1196 | usb_resume_interface(udev, intf, msg, 0); | 1198 | usb_resume_interface(udev, intf, msg, 0); |
1197 | } | 1199 | } |
@@ -1262,13 +1264,47 @@ static int usb_resume_both(struct usb_device *udev, pm_message_t msg) | |||
1262 | return status; | 1264 | return status; |
1263 | } | 1265 | } |
1264 | 1266 | ||
1267 | static void choose_wakeup(struct usb_device *udev, pm_message_t msg) | ||
1268 | { | ||
1269 | int w, i; | ||
1270 | struct usb_interface *intf; | ||
1271 | |||
1272 | /* Remote wakeup is needed only when we actually go to sleep. | ||
1273 | * For things like FREEZE and QUIESCE, if the device is already | ||
1274 | * autosuspended then its current wakeup setting is okay. | ||
1275 | */ | ||
1276 | if (msg.event == PM_EVENT_FREEZE || msg.event == PM_EVENT_QUIESCE) { | ||
1277 | if (udev->state != USB_STATE_SUSPENDED) | ||
1278 | udev->do_remote_wakeup = 0; | ||
1279 | return; | ||
1280 | } | ||
1281 | |||
1282 | /* If remote wakeup is permitted, see whether any interface drivers | ||
1283 | * actually want it. | ||
1284 | */ | ||
1285 | w = 0; | ||
1286 | if (device_may_wakeup(&udev->dev) && udev->actconfig) { | ||
1287 | for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) { | ||
1288 | intf = udev->actconfig->interface[i]; | ||
1289 | w |= intf->needs_remote_wakeup; | ||
1290 | } | ||
1291 | } | ||
1292 | |||
1293 | /* If the device is autosuspended with the wrong wakeup setting, | ||
1294 | * autoresume now so the setting can be changed. | ||
1295 | */ | ||
1296 | if (udev->state == USB_STATE_SUSPENDED && w != udev->do_remote_wakeup) | ||
1297 | pm_runtime_resume(&udev->dev); | ||
1298 | udev->do_remote_wakeup = w; | ||
1299 | } | ||
1300 | |||
1265 | /* The device lock is held by the PM core */ | 1301 | /* The device lock is held by the PM core */ |
1266 | int usb_suspend(struct device *dev, pm_message_t msg) | 1302 | int usb_suspend(struct device *dev, pm_message_t msg) |
1267 | { | 1303 | { |
1268 | struct usb_device *udev = to_usb_device(dev); | 1304 | struct usb_device *udev = to_usb_device(dev); |
1269 | 1305 | ||
1270 | do_unbind_rebind(udev, DO_UNBIND); | 1306 | do_unbind_rebind(udev, DO_UNBIND); |
1271 | udev->do_remote_wakeup = device_may_wakeup(&udev->dev); | 1307 | choose_wakeup(udev, msg); |
1272 | return usb_suspend_both(udev, msg); | 1308 | return usb_suspend_both(udev, msg); |
1273 | } | 1309 | } |
1274 | 1310 | ||
diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index d26b9ea981f9..4f84a41ee7a8 100644 --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/spinlock.h> | 13 | #include <linux/spinlock.h> |
14 | #include <linux/slab.h> | ||
14 | #include <linux/idr.h> | 15 | #include <linux/idr.h> |
15 | #include <linux/usb.h> | 16 | #include <linux/usb.h> |
16 | #include "usb.h" | 17 | #include "usb.h" |
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index c3536f151f02..f06f5dbc8cdc 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
20 | #include <linux/rwsem.h> | 20 | #include <linux/rwsem.h> |
21 | #include <linux/slab.h> | ||
21 | #include <linux/smp_lock.h> | 22 | #include <linux/smp_lock.h> |
22 | #include <linux/usb.h> | 23 | #include <linux/usb.h> |
23 | 24 | ||
diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c index bdf87a8414a1..2c95153c0f24 100644 --- a/drivers/usb/core/generic.c +++ b/drivers/usb/core/generic.c | |||
@@ -120,7 +120,7 @@ int usb_choose_configuration(struct usb_device *udev) | |||
120 | * than a vendor-specific driver. */ | 120 | * than a vendor-specific driver. */ |
121 | else if (udev->descriptor.bDeviceClass != | 121 | else if (udev->descriptor.bDeviceClass != |
122 | USB_CLASS_VENDOR_SPEC && | 122 | USB_CLASS_VENDOR_SPEC && |
123 | (!desc || desc->bInterfaceClass != | 123 | (desc && desc->bInterfaceClass != |
124 | USB_CLASS_VENDOR_SPEC)) { | 124 | USB_CLASS_VENDOR_SPEC)) { |
125 | best = c; | 125 | best = c; |
126 | break; | 126 | break; |
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 97b40ce133f0..111a01a747fc 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c | |||
@@ -380,6 +380,7 @@ static int usbfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
380 | mutex_lock(&inode->i_mutex); | 380 | mutex_lock(&inode->i_mutex); |
381 | dentry_unhash(dentry); | 381 | dentry_unhash(dentry); |
382 | if (usbfs_empty(dentry)) { | 382 | if (usbfs_empty(dentry)) { |
383 | dont_mount(dentry); | ||
383 | drop_nlink(dentry->d_inode); | 384 | drop_nlink(dentry->d_inode); |
384 | drop_nlink(dentry->d_inode); | 385 | drop_nlink(dentry->d_inode); |
385 | dput(dentry); | 386 | dput(dentry); |
@@ -515,13 +516,13 @@ static int fs_create_by_name (const char *name, mode_t mode, | |||
515 | *dentry = NULL; | 516 | *dentry = NULL; |
516 | mutex_lock(&parent->d_inode->i_mutex); | 517 | mutex_lock(&parent->d_inode->i_mutex); |
517 | *dentry = lookup_one_len(name, parent, strlen(name)); | 518 | *dentry = lookup_one_len(name, parent, strlen(name)); |
518 | if (!IS_ERR(dentry)) { | 519 | if (!IS_ERR(*dentry)) { |
519 | if ((mode & S_IFMT) == S_IFDIR) | 520 | if ((mode & S_IFMT) == S_IFDIR) |
520 | error = usbfs_mkdir (parent->d_inode, *dentry, mode); | 521 | error = usbfs_mkdir (parent->d_inode, *dentry, mode); |
521 | else | 522 | else |
522 | error = usbfs_create (parent->d_inode, *dentry, mode); | 523 | error = usbfs_create (parent->d_inode, *dentry, mode); |
523 | } else | 524 | } else |
524 | error = PTR_ERR(dentry); | 525 | error = PTR_ERR(*dentry); |
525 | mutex_unlock(&parent->d_inode->i_mutex); | 526 | mutex_unlock(&parent->d_inode->i_mutex); |
526 | 527 | ||
527 | return error; | 528 | return error; |
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index 27080561a1c2..45a32dadb406 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
@@ -453,6 +453,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
453 | if (urb->interval > (1 << 15)) | 453 | if (urb->interval > (1 << 15)) |
454 | return -EINVAL; | 454 | return -EINVAL; |
455 | max = 1 << 15; | 455 | max = 1 << 15; |
456 | break; | ||
456 | case USB_SPEED_WIRELESS: | 457 | case USB_SPEED_WIRELESS: |
457 | if (urb->interval > 16) | 458 | if (urb->interval > 16) |
458 | return -EINVAL; | 459 | return -EINVAL; |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 1297e9b16a51..0561430f2ede 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -718,7 +718,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size, | |||
718 | EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor); | 718 | EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor); |
719 | 719 | ||
720 | /** | 720 | /** |
721 | * usb_buffer_alloc - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP | 721 | * usb_alloc_coherent - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP |
722 | * @dev: device the buffer will be used with | 722 | * @dev: device the buffer will be used with |
723 | * @size: requested buffer size | 723 | * @size: requested buffer size |
724 | * @mem_flags: affect whether allocation may block | 724 | * @mem_flags: affect whether allocation may block |
@@ -737,30 +737,30 @@ EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor); | |||
737 | * architectures where CPU caches are not DMA-coherent. On systems without | 737 | * architectures where CPU caches are not DMA-coherent. On systems without |
738 | * bus-snooping caches, these buffers are uncached. | 738 | * bus-snooping caches, these buffers are uncached. |
739 | * | 739 | * |
740 | * When the buffer is no longer used, free it with usb_buffer_free(). | 740 | * When the buffer is no longer used, free it with usb_free_coherent(). |
741 | */ | 741 | */ |
742 | void *usb_buffer_alloc(struct usb_device *dev, size_t size, gfp_t mem_flags, | 742 | void *usb_alloc_coherent(struct usb_device *dev, size_t size, gfp_t mem_flags, |
743 | dma_addr_t *dma) | 743 | dma_addr_t *dma) |
744 | { | 744 | { |
745 | if (!dev || !dev->bus) | 745 | if (!dev || !dev->bus) |
746 | return NULL; | 746 | return NULL; |
747 | return hcd_buffer_alloc(dev->bus, size, mem_flags, dma); | 747 | return hcd_buffer_alloc(dev->bus, size, mem_flags, dma); |
748 | } | 748 | } |
749 | EXPORT_SYMBOL_GPL(usb_buffer_alloc); | 749 | EXPORT_SYMBOL_GPL(usb_alloc_coherent); |
750 | 750 | ||
751 | /** | 751 | /** |
752 | * usb_buffer_free - free memory allocated with usb_buffer_alloc() | 752 | * usb_free_coherent - free memory allocated with usb_alloc_coherent() |
753 | * @dev: device the buffer was used with | 753 | * @dev: device the buffer was used with |
754 | * @size: requested buffer size | 754 | * @size: requested buffer size |
755 | * @addr: CPU address of buffer | 755 | * @addr: CPU address of buffer |
756 | * @dma: DMA address of buffer | 756 | * @dma: DMA address of buffer |
757 | * | 757 | * |
758 | * This reclaims an I/O buffer, letting it be reused. The memory must have | 758 | * This reclaims an I/O buffer, letting it be reused. The memory must have |
759 | * been allocated using usb_buffer_alloc(), and the parameters must match | 759 | * been allocated using usb_alloc_coherent(), and the parameters must match |
760 | * those provided in that allocation request. | 760 | * those provided in that allocation request. |
761 | */ | 761 | */ |
762 | void usb_buffer_free(struct usb_device *dev, size_t size, void *addr, | 762 | void usb_free_coherent(struct usb_device *dev, size_t size, void *addr, |
763 | dma_addr_t dma) | 763 | dma_addr_t dma) |
764 | { | 764 | { |
765 | if (!dev || !dev->bus) | 765 | if (!dev || !dev->bus) |
766 | return; | 766 | return; |
@@ -768,7 +768,7 @@ void usb_buffer_free(struct usb_device *dev, size_t size, void *addr, | |||
768 | return; | 768 | return; |
769 | hcd_buffer_free(dev->bus, size, addr, dma); | 769 | hcd_buffer_free(dev->bus, size, addr, dma); |
770 | } | 770 | } |
771 | EXPORT_SYMBOL_GPL(usb_buffer_free); | 771 | EXPORT_SYMBOL_GPL(usb_free_coherent); |
772 | 772 | ||
773 | /** | 773 | /** |
774 | * usb_buffer_map - create DMA mapping(s) for an urb | 774 | * usb_buffer_map - create DMA mapping(s) for an urb |
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 7460cd797f45..11a3e0fa4331 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig | |||
@@ -747,7 +747,7 @@ config USB_MASS_STORAGE | |||
747 | which may be used with composite framework. | 747 | which may be used with composite framework. |
748 | 748 | ||
749 | Say "y" to link the driver statically, or "m" to build | 749 | Say "y" to link the driver statically, or "m" to build |
750 | a dynamically linked module called "g_file_storage". If unsure, | 750 | a dynamically linked module called "g_mass_storage". If unsure, |
751 | consider File-backed Storage Gadget. | 751 | consider File-backed Storage Gadget. |
752 | 752 | ||
753 | config USB_G_SERIAL | 753 | config USB_G_SERIAL |
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 12ac9cd32a07..df1bae9b048e 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
@@ -1370,6 +1370,12 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc) | |||
1370 | { | 1370 | { |
1371 | struct at91_udc *udc = _udc; | 1371 | struct at91_udc *udc = _udc; |
1372 | u32 rescans = 5; | 1372 | u32 rescans = 5; |
1373 | int disable_clock = 0; | ||
1374 | |||
1375 | if (!udc->clocked) { | ||
1376 | clk_on(udc); | ||
1377 | disable_clock = 1; | ||
1378 | } | ||
1373 | 1379 | ||
1374 | while (rescans--) { | 1380 | while (rescans--) { |
1375 | u32 status; | 1381 | u32 status; |
@@ -1458,6 +1464,9 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc) | |||
1458 | } | 1464 | } |
1459 | } | 1465 | } |
1460 | 1466 | ||
1467 | if (disable_clock) | ||
1468 | clk_off(udc); | ||
1469 | |||
1461 | return IRQ_HANDLED; | 1470 | return IRQ_HANDLED; |
1462 | } | 1471 | } |
1463 | 1472 | ||
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index f79bdfe4bed9..75a256f3d45b 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/slab.h> | ||
15 | #include <linux/device.h> | 16 | #include <linux/device.h> |
16 | #include <linux/dma-mapping.h> | 17 | #include <linux/dma-mapping.h> |
17 | #include <linux/list.h> | 18 | #include <linux/list.h> |
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c index c7cb87a6fee2..699695128e33 100644 --- a/drivers/usb/gadget/ci13xxx_udc.c +++ b/drivers/usb/gadget/ci13xxx_udc.c | |||
@@ -62,6 +62,7 @@ | |||
62 | #include <linux/kernel.h> | 62 | #include <linux/kernel.h> |
63 | #include <linux/module.h> | 63 | #include <linux/module.h> |
64 | #include <linux/pci.h> | 64 | #include <linux/pci.h> |
65 | #include <linux/slab.h> | ||
65 | #include <linux/usb/ch9.h> | 66 | #include <linux/usb/ch9.h> |
66 | #include <linux/usb/gadget.h> | 67 | #include <linux/usb/gadget.h> |
67 | 68 | ||
diff --git a/drivers/usb/gadget/config.c b/drivers/usb/gadget/config.c index e1191b9a316a..47e8e722682c 100644 --- a/drivers/usb/gadget/config.c +++ b/drivers/usb/gadget/config.c | |||
@@ -19,6 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
22 | #include <linux/slab.h> | ||
22 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
23 | #include <linux/list.h> | 24 | #include <linux/list.h> |
24 | #include <linux/string.h> | 25 | #include <linux/string.h> |
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index 65a5f94cbc04..3568de210f79 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c | |||
@@ -266,7 +266,7 @@ struct usb_ep * __init usb_ep_autoconfig ( | |||
266 | } | 266 | } |
267 | 267 | ||
268 | #ifdef CONFIG_BLACKFIN | 268 | #ifdef CONFIG_BLACKFIN |
269 | } else if (gadget_is_musbhsfc(gadget) || gadget_is_musbhdrc(gadget)) { | 269 | } else if (gadget_is_musbhdrc(gadget)) { |
270 | if ((USB_ENDPOINT_XFER_BULK == type) || | 270 | if ((USB_ENDPOINT_XFER_BULK == type) || |
271 | (USB_ENDPOINT_XFER_ISOC == type)) { | 271 | (USB_ENDPOINT_XFER_ISOC == type)) { |
272 | if (USB_DIR_IN & desc->bEndpointAddress) | 272 | if (USB_DIR_IN & desc->bEndpointAddress) |
diff --git a/drivers/usb/gadget/f_acm.c b/drivers/usb/gadget/f_acm.c index e49c7325dce2..400e1ebe6976 100644 --- a/drivers/usb/gadget/f_acm.c +++ b/drivers/usb/gadget/f_acm.c | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | /* #define VERBOSE_DEBUG */ | 15 | /* #define VERBOSE_DEBUG */ |
16 | 16 | ||
17 | #include <linux/slab.h> | ||
17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
18 | #include <linux/device.h> | 19 | #include <linux/device.h> |
19 | 20 | ||
diff --git a/drivers/usb/gadget/f_audio.c b/drivers/usb/gadget/f_audio.c index f1e3aad76c37..43bf44514c41 100644 --- a/drivers/usb/gadget/f_audio.c +++ b/drivers/usb/gadget/f_audio.c | |||
@@ -9,6 +9,7 @@ | |||
9 | * Licensed under the GPL-2 or later. | 9 | * Licensed under the GPL-2 or later. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/slab.h> | ||
12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
13 | #include <linux/device.h> | 14 | #include <linux/device.h> |
14 | #include <asm/atomic.h> | 15 | #include <asm/atomic.h> |
diff --git a/drivers/usb/gadget/f_ecm.c b/drivers/usb/gadget/f_ecm.c index 2fff530efc19..4e595324c614 100644 --- a/drivers/usb/gadget/f_ecm.c +++ b/drivers/usb/gadget/f_ecm.c | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | /* #define VERBOSE_DEBUG */ | 22 | /* #define VERBOSE_DEBUG */ |
23 | 23 | ||
24 | #include <linux/slab.h> | ||
24 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
25 | #include <linux/device.h> | 26 | #include <linux/device.h> |
26 | #include <linux/etherdevice.h> | 27 | #include <linux/etherdevice.h> |
diff --git a/drivers/usb/gadget/f_eem.c b/drivers/usb/gadget/f_eem.c index d4f0db58a8ad..38226e9a371d 100644 --- a/drivers/usb/gadget/f_eem.c +++ b/drivers/usb/gadget/f_eem.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/device.h> | 24 | #include <linux/device.h> |
25 | #include <linux/etherdevice.h> | 25 | #include <linux/etherdevice.h> |
26 | #include <linux/crc32.h> | 26 | #include <linux/crc32.h> |
27 | #include <linux/slab.h> | ||
27 | 28 | ||
28 | #include "u_ether.h" | 29 | #include "u_ether.h" |
29 | 30 | ||
diff --git a/drivers/usb/gadget/f_loopback.c b/drivers/usb/gadget/f_loopback.c index 6cb29d3df575..e91d1b16d9be 100644 --- a/drivers/usb/gadget/f_loopback.c +++ b/drivers/usb/gadget/f_loopback.c | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | /* #define VERBOSE_DEBUG */ | 22 | /* #define VERBOSE_DEBUG */ |
23 | 23 | ||
24 | #include <linux/slab.h> | ||
24 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
25 | #include <linux/device.h> | 26 | #include <linux/device.h> |
26 | 27 | ||
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 5a3cdd08f1d0..f4911c09022e 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c | |||
@@ -2910,7 +2910,7 @@ static void fsg_unbind(struct usb_configuration *c, struct usb_function *f) | |||
2910 | } | 2910 | } |
2911 | 2911 | ||
2912 | 2912 | ||
2913 | static int fsg_bind(struct usb_configuration *c, struct usb_function *f) | 2913 | static int __init fsg_bind(struct usb_configuration *c, struct usb_function *f) |
2914 | { | 2914 | { |
2915 | struct fsg_dev *fsg = fsg_from_func(f); | 2915 | struct fsg_dev *fsg = fsg_from_func(f); |
2916 | struct usb_gadget *gadget = c->cdev->gadget; | 2916 | struct usb_gadget *gadget = c->cdev->gadget; |
@@ -2954,7 +2954,6 @@ static int fsg_bind(struct usb_configuration *c, struct usb_function *f) | |||
2954 | autoconf_fail: | 2954 | autoconf_fail: |
2955 | ERROR(fsg, "unable to autoconfigure all endpoints\n"); | 2955 | ERROR(fsg, "unable to autoconfigure all endpoints\n"); |
2956 | rc = -ENOTSUPP; | 2956 | rc = -ENOTSUPP; |
2957 | fsg_unbind(c, f); | ||
2958 | return rc; | 2957 | return rc; |
2959 | } | 2958 | } |
2960 | 2959 | ||
diff --git a/drivers/usb/gadget/f_obex.c b/drivers/usb/gadget/f_obex.c index b4a3ba654ea5..8f8c64371475 100644 --- a/drivers/usb/gadget/f_obex.c +++ b/drivers/usb/gadget/f_obex.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | /* #define VERBOSE_DEBUG */ | 24 | /* #define VERBOSE_DEBUG */ |
25 | 25 | ||
26 | #include <linux/slab.h> | ||
26 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
27 | #include <linux/device.h> | 28 | #include <linux/device.h> |
28 | 29 | ||
diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c index d2de10b9dc4b..3c6e1a058745 100644 --- a/drivers/usb/gadget/f_phonet.c +++ b/drivers/usb/gadget/f_phonet.c | |||
@@ -20,6 +20,7 @@ | |||
20 | * 02110-1301 USA | 20 | * 02110-1301 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/slab.h> | ||
23 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
24 | #include <linux/device.h> | 25 | #include <linux/device.h> |
25 | 26 | ||
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index a30e60c7f129..56b022150f22 100644 --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | /* #define VERBOSE_DEBUG */ | 25 | /* #define VERBOSE_DEBUG */ |
26 | 26 | ||
27 | #include <linux/slab.h> | ||
27 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
28 | #include <linux/device.h> | 29 | #include <linux/device.h> |
29 | #include <linux/etherdevice.h> | 30 | #include <linux/etherdevice.h> |
diff --git a/drivers/usb/gadget/f_serial.c b/drivers/usb/gadget/f_serial.c index db0aa93606ef..490b00b01a7d 100644 --- a/drivers/usb/gadget/f_serial.c +++ b/drivers/usb/gadget/f_serial.c | |||
@@ -10,6 +10,7 @@ | |||
10 | * either version 2 of that License or (at your option) any later version. | 10 | * either version 2 of that License or (at your option) any later version. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/slab.h> | ||
13 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
14 | #include <linux/device.h> | 15 | #include <linux/device.h> |
15 | 16 | ||
diff --git a/drivers/usb/gadget/f_sourcesink.c b/drivers/usb/gadget/f_sourcesink.c index 09cba273d2db..6d3cc443d914 100644 --- a/drivers/usb/gadget/f_sourcesink.c +++ b/drivers/usb/gadget/f_sourcesink.c | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | /* #define VERBOSE_DEBUG */ | 22 | /* #define VERBOSE_DEBUG */ |
23 | 23 | ||
24 | #include <linux/slab.h> | ||
24 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
25 | #include <linux/device.h> | 26 | #include <linux/device.h> |
26 | 27 | ||
diff --git a/drivers/usb/gadget/f_subset.c b/drivers/usb/gadget/f_subset.c index a9c98fdb626d..8675ca415329 100644 --- a/drivers/usb/gadget/f_subset.c +++ b/drivers/usb/gadget/f_subset.c | |||
@@ -19,6 +19,7 @@ | |||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/slab.h> | ||
22 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
23 | #include <linux/device.h> | 24 | #include <linux/device.h> |
24 | #include <linux/etherdevice.h> | 25 | #include <linux/etherdevice.h> |
diff --git a/drivers/usb/gadget/fsl_mx3_udc.c b/drivers/usb/gadget/fsl_mx3_udc.c index 4bc2bf3d602e..20a802ecaa15 100644 --- a/drivers/usb/gadget/fsl_mx3_udc.c +++ b/drivers/usb/gadget/fsl_mx3_udc.c | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <linux/fsl_devices.h> | 17 | #include <linux/fsl_devices.h> |
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | 19 | ||
20 | #include <mach/hardware.h> | ||
21 | |||
20 | static struct clk *mxc_ahb_clk; | 22 | static struct clk *mxc_ahb_clk; |
21 | static struct clk *mxc_usb_clk; | 23 | static struct clk *mxc_usb_clk; |
22 | 24 | ||
@@ -28,14 +30,16 @@ int fsl_udc_clk_init(struct platform_device *pdev) | |||
28 | 30 | ||
29 | pdata = pdev->dev.platform_data; | 31 | pdata = pdev->dev.platform_data; |
30 | 32 | ||
31 | mxc_ahb_clk = clk_get(&pdev->dev, "usb_ahb"); | 33 | if (!cpu_is_mx35()) { |
32 | if (IS_ERR(mxc_ahb_clk)) | 34 | mxc_ahb_clk = clk_get(&pdev->dev, "usb_ahb"); |
33 | return PTR_ERR(mxc_ahb_clk); | 35 | if (IS_ERR(mxc_ahb_clk)) |
36 | return PTR_ERR(mxc_ahb_clk); | ||
34 | 37 | ||
35 | ret = clk_enable(mxc_ahb_clk); | 38 | ret = clk_enable(mxc_ahb_clk); |
36 | if (ret < 0) { | 39 | if (ret < 0) { |
37 | dev_err(&pdev->dev, "clk_enable(\"usb_ahb\") failed\n"); | 40 | dev_err(&pdev->dev, "clk_enable(\"usb_ahb\") failed\n"); |
38 | goto eenahb; | 41 | goto eenahb; |
42 | } | ||
39 | } | 43 | } |
40 | 44 | ||
41 | /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */ | 45 | /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */ |
@@ -50,6 +54,7 @@ int fsl_udc_clk_init(struct platform_device *pdev) | |||
50 | if (pdata->phy_mode != FSL_USB2_PHY_ULPI && | 54 | if (pdata->phy_mode != FSL_USB2_PHY_ULPI && |
51 | (freq < 59999000 || freq > 60001000)) { | 55 | (freq < 59999000 || freq > 60001000)) { |
52 | dev_err(&pdev->dev, "USB_CLK=%lu, should be 60MHz\n", freq); | 56 | dev_err(&pdev->dev, "USB_CLK=%lu, should be 60MHz\n", freq); |
57 | ret = -EINVAL; | ||
53 | goto eclkrate; | 58 | goto eclkrate; |
54 | } | 59 | } |
55 | 60 | ||
@@ -66,9 +71,11 @@ eclkrate: | |||
66 | clk_put(mxc_usb_clk); | 71 | clk_put(mxc_usb_clk); |
67 | mxc_usb_clk = NULL; | 72 | mxc_usb_clk = NULL; |
68 | egusb: | 73 | egusb: |
69 | clk_disable(mxc_ahb_clk); | 74 | if (!cpu_is_mx35()) |
75 | clk_disable(mxc_ahb_clk); | ||
70 | eenahb: | 76 | eenahb: |
71 | clk_put(mxc_ahb_clk); | 77 | if (!cpu_is_mx35()) |
78 | clk_put(mxc_ahb_clk); | ||
72 | return ret; | 79 | return ret; |
73 | } | 80 | } |
74 | 81 | ||
@@ -90,6 +97,8 @@ void fsl_udc_clk_release(void) | |||
90 | clk_disable(mxc_usb_clk); | 97 | clk_disable(mxc_usb_clk); |
91 | clk_put(mxc_usb_clk); | 98 | clk_put(mxc_usb_clk); |
92 | } | 99 | } |
93 | clk_disable(mxc_ahb_clk); | 100 | if (!cpu_is_mx35()) { |
94 | clk_put(mxc_ahb_clk); | 101 | clk_disable(mxc_ahb_clk); |
102 | clk_put(mxc_ahb_clk); | ||
103 | } | ||
95 | } | 104 | } |
diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h index 1edbc12fff18..e511fec9f26d 100644 --- a/drivers/usb/gadget/gadget_chips.h +++ b/drivers/usb/gadget/gadget_chips.h | |||
@@ -136,6 +136,12 @@ | |||
136 | #define gadget_is_r8a66597(g) 0 | 136 | #define gadget_is_r8a66597(g) 0 |
137 | #endif | 137 | #endif |
138 | 138 | ||
139 | #ifdef CONFIG_USB_S3C_HSOTG | ||
140 | #define gadget_is_s3c_hsotg(g) (!strcmp("s3c-hsotg", (g)->name)) | ||
141 | #else | ||
142 | #define gadget_is_s3c_hsotg(g) 0 | ||
143 | #endif | ||
144 | |||
139 | 145 | ||
140 | /** | 146 | /** |
141 | * usb_gadget_controller_number - support bcdDevice id convention | 147 | * usb_gadget_controller_number - support bcdDevice id convention |
@@ -192,6 +198,8 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget) | |||
192 | return 0x24; | 198 | return 0x24; |
193 | else if (gadget_is_r8a66597(gadget)) | 199 | else if (gadget_is_r8a66597(gadget)) |
194 | return 0x25; | 200 | return 0x25; |
201 | else if (gadget_is_s3c_hsotg(gadget)) | ||
202 | return 0x26; | ||
195 | return -ENOENT; | 203 | return -ENOENT; |
196 | } | 204 | } |
197 | 205 | ||
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c index 04f6224b7e06..2b56ce621852 100644 --- a/drivers/usb/gadget/gmidi.c +++ b/drivers/usb/gadget/gmidi.c | |||
@@ -21,6 +21,7 @@ | |||
21 | /* #define VERBOSE_DEBUG */ | 21 | /* #define VERBOSE_DEBUG */ |
22 | 22 | ||
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | #include <linux/slab.h> | ||
24 | #include <linux/utsname.h> | 25 | #include <linux/utsname.h> |
25 | #include <linux/device.h> | 26 | #include <linux/device.h> |
26 | 27 | ||
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index e8edc640381e..1088d08c7ed8 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb/gadget/goku_udc.c | |||
@@ -1768,7 +1768,7 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1768 | * usb_gadget_driver_{register,unregister}() must change. | 1768 | * usb_gadget_driver_{register,unregister}() must change. |
1769 | */ | 1769 | */ |
1770 | if (the_controller) { | 1770 | if (the_controller) { |
1771 | WARNING(dev, "ignoring %s\n", pci_name(pdev)); | 1771 | pr_warning("ignoring %s\n", pci_name(pdev)); |
1772 | return -EBUSY; | 1772 | return -EBUSY; |
1773 | } | 1773 | } |
1774 | if (!pdev->irq) { | 1774 | if (!pdev->irq) { |
diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c index 01ee0b9bc957..e743122fcd93 100644 --- a/drivers/usb/gadget/imx_udc.c +++ b/drivers/usb/gadget/imx_udc.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/clk.h> | 29 | #include <linux/clk.h> |
30 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
31 | #include <linux/timer.h> | 31 | #include <linux/timer.h> |
32 | #include <linux/slab.h> | ||
32 | 33 | ||
33 | #include <linux/usb/ch9.h> | 34 | #include <linux/usb/ch9.h> |
34 | #include <linux/usb/gadget.h> | 35 | #include <linux/usb/gadget.h> |
diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c index 6cd3d54f5640..fded3fca793b 100644 --- a/drivers/usb/gadget/lh7a40x_udc.c +++ b/drivers/usb/gadget/lh7a40x_udc.c | |||
@@ -22,6 +22,7 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | #include <linux/slab.h> | ||
25 | 26 | ||
26 | #include "lh7a40x_udc.h" | 27 | #include "lh7a40x_udc.h" |
27 | 28 | ||
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c index a8c8543d1b08..166bf71fd348 100644 --- a/drivers/usb/gadget/m66592-udc.c +++ b/drivers/usb/gadget/m66592-udc.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/slab.h> | ||
28 | #include <linux/err.h> | 29 | #include <linux/err.h> |
29 | #include <linux/usb/ch9.h> | 30 | #include <linux/usb/ch9.h> |
30 | #include <linux/usb/gadget.h> | 31 | #include <linux/usb/gadget.h> |
diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c index 76496f5d272c..a930d7fd7e7a 100644 --- a/drivers/usb/gadget/multi.c +++ b/drivers/usb/gadget/multi.c | |||
@@ -211,8 +211,6 @@ static int __init cdc_do_config(struct usb_configuration *c) | |||
211 | ret = fsg_add(c->cdev, c, fsg_common); | 211 | ret = fsg_add(c->cdev, c, fsg_common); |
212 | if (ret < 0) | 212 | if (ret < 0) |
213 | return ret; | 213 | return ret; |
214 | if (ret < 0) | ||
215 | return ret; | ||
216 | 214 | ||
217 | return 0; | 215 | return 0; |
218 | } | 216 | } |
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index e6fedbd5a654..be5fb34d9602 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c | |||
@@ -65,6 +65,10 @@ | |||
65 | #include <mach/pxa25x-udc.h> | 65 | #include <mach/pxa25x-udc.h> |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | #ifdef CONFIG_ARCH_LUBBOCK | ||
69 | #include <mach/lubbock.h> | ||
70 | #endif | ||
71 | |||
68 | #include <asm/mach/udc_pxa2xx.h> | 72 | #include <asm/mach/udc_pxa2xx.h> |
69 | 73 | ||
70 | 74 | ||
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c index 05b892c3d686..85b0d8921eae 100644 --- a/drivers/usb/gadget/pxa27x_udc.c +++ b/drivers/usb/gadget/pxa27x_udc.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/clk.h> | 31 | #include <linux/clk.h> |
32 | #include <linux/irq.h> | 32 | #include <linux/irq.h> |
33 | #include <linux/gpio.h> | 33 | #include <linux/gpio.h> |
34 | #include <linux/slab.h> | ||
34 | 35 | ||
35 | #include <asm/byteorder.h> | 36 | #include <asm/byteorder.h> |
36 | #include <mach/hardware.h> | 37 | #include <mach/hardware.h> |
diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c index 8b45145b9136..888d8f166c0b 100644 --- a/drivers/usb/gadget/r8a66597-udc.c +++ b/drivers/usb/gadget/r8a66597-udc.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/clk.h> | 28 | #include <linux/clk.h> |
29 | #include <linux/err.h> | 29 | #include <linux/err.h> |
30 | #include <linux/slab.h> | ||
30 | 31 | ||
31 | #include <linux/usb/ch9.h> | 32 | #include <linux/usb/ch9.h> |
32 | #include <linux/usb/gadget.h> | 33 | #include <linux/usb/gadget.h> |
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c index 48267bc0b2e0..5c0d06c79a81 100644 --- a/drivers/usb/gadget/rndis.c +++ b/drivers/usb/gadget/rndis.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/list.h> | 29 | #include <linux/list.h> |
30 | #include <linux/proc_fs.h> | 30 | #include <linux/proc_fs.h> |
31 | #include <linux/slab.h> | ||
31 | #include <linux/seq_file.h> | 32 | #include <linux/seq_file.h> |
32 | #include <linux/netdevice.h> | 33 | #include <linux/netdevice.h> |
33 | 34 | ||
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 7e5bf593d386..1f73b485732d 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/seq_file.h> | 22 | #include <linux/seq_file.h> |
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/slab.h> | ||
25 | 26 | ||
26 | #include <linux/usb/ch9.h> | 27 | #include <linux/usb/ch9.h> |
27 | #include <linux/usb/gadget.h> | 28 | #include <linux/usb/gadget.h> |
@@ -30,7 +31,7 @@ | |||
30 | 31 | ||
31 | #include <plat/regs-usb-hsotg-phy.h> | 32 | #include <plat/regs-usb-hsotg-phy.h> |
32 | #include <plat/regs-usb-hsotg.h> | 33 | #include <plat/regs-usb-hsotg.h> |
33 | #include <plat/regs-sys.h> | 34 | #include <mach/regs-sys.h> |
34 | #include <plat/udc-hs.h> | 35 | #include <plat/udc-hs.h> |
35 | 36 | ||
36 | #define DMA_ADDR_INVALID (~((dma_addr_t)0)) | 37 | #define DMA_ADDR_INVALID (~((dma_addr_t)0)) |
@@ -2144,6 +2145,7 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, | |||
2144 | u32 epctrl; | 2145 | u32 epctrl; |
2145 | u32 mps; | 2146 | u32 mps; |
2146 | int dir_in; | 2147 | int dir_in; |
2148 | int ret = 0; | ||
2147 | 2149 | ||
2148 | dev_dbg(hsotg->dev, | 2150 | dev_dbg(hsotg->dev, |
2149 | "%s: ep %s: a 0x%02x, attr 0x%02x, mps 0x%04x, intr %d\n", | 2151 | "%s: ep %s: a 0x%02x, attr 0x%02x, mps 0x%04x, intr %d\n", |
@@ -2195,7 +2197,8 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, | |||
2195 | switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { | 2197 | switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { |
2196 | case USB_ENDPOINT_XFER_ISOC: | 2198 | case USB_ENDPOINT_XFER_ISOC: |
2197 | dev_err(hsotg->dev, "no current ISOC support\n"); | 2199 | dev_err(hsotg->dev, "no current ISOC support\n"); |
2198 | return -EINVAL; | 2200 | ret = -EINVAL; |
2201 | goto out; | ||
2199 | 2202 | ||
2200 | case USB_ENDPOINT_XFER_BULK: | 2203 | case USB_ENDPOINT_XFER_BULK: |
2201 | epctrl |= S3C_DxEPCTL_EPType_Bulk; | 2204 | epctrl |= S3C_DxEPCTL_EPType_Bulk; |
@@ -2234,8 +2237,9 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, | |||
2234 | /* enable the endpoint interrupt */ | 2237 | /* enable the endpoint interrupt */ |
2235 | s3c_hsotg_ctrl_epint(hsotg, index, dir_in, 1); | 2238 | s3c_hsotg_ctrl_epint(hsotg, index, dir_in, 1); |
2236 | 2239 | ||
2240 | out: | ||
2237 | spin_unlock_irqrestore(&hs_ep->lock, flags); | 2241 | spin_unlock_irqrestore(&hs_ep->lock, flags); |
2238 | return 0; | 2242 | return ret; |
2239 | } | 2243 | } |
2240 | 2244 | ||
2241 | static int s3c_hsotg_ep_disable(struct usb_ep *ep) | 2245 | static int s3c_hsotg_ep_disable(struct usb_ep *ep) |
diff --git a/drivers/usb/gadget/u_audio.c b/drivers/usb/gadget/u_audio.c index 35e0930f5bbb..7a86d2c9109c 100644 --- a/drivers/usb/gadget/u_audio.c +++ b/drivers/usb/gadget/u_audio.c | |||
@@ -10,6 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/slab.h> | ||
13 | #include <linux/device.h> | 14 | #include <linux/device.h> |
14 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
15 | #include <linux/ctype.h> | 16 | #include <linux/ctype.h> |
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c index 84ca195c2d10..07f4178ad178 100644 --- a/drivers/usb/gadget/u_ether.c +++ b/drivers/usb/gadget/u_ether.c | |||
@@ -23,6 +23,7 @@ | |||
23 | /* #define VERBOSE_DEBUG */ | 23 | /* #define VERBOSE_DEBUG */ |
24 | 24 | ||
25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
26 | #include <linux/gfp.h> | ||
26 | #include <linux/device.h> | 27 | #include <linux/device.h> |
27 | #include <linux/ctype.h> | 28 | #include <linux/ctype.h> |
28 | #include <linux/etherdevice.h> | 29 | #include <linux/etherdevice.h> |
diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c index adf8260c3a6a..16bdf77f582a 100644 --- a/drivers/usb/gadget/u_serial.c +++ b/drivers/usb/gadget/u_serial.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/tty.h> | 24 | #include <linux/tty.h> |
25 | #include <linux/tty_flip.h> | 25 | #include <linux/tty_flip.h> |
26 | #include <linux/slab.h> | ||
26 | 27 | ||
27 | #include "u_serial.h" | 28 | #include "u_serial.h" |
28 | 29 | ||
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c index fac81ee193dd..807280d069f9 100644 --- a/drivers/usb/gadget/zero.c +++ b/drivers/usb/gadget/zero.c | |||
@@ -50,6 +50,7 @@ | |||
50 | /* #define VERBOSE_DEBUG */ | 50 | /* #define VERBOSE_DEBUG */ |
51 | 51 | ||
52 | #include <linux/kernel.h> | 52 | #include <linux/kernel.h> |
53 | #include <linux/slab.h> | ||
53 | #include <linux/utsname.h> | 54 | #include <linux/utsname.h> |
54 | #include <linux/device.h> | 55 | #include <linux/device.h> |
55 | 56 | ||
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index 4e0c67f1f51b..b6315aa47f7a 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile | |||
@@ -12,7 +12,7 @@ fhci-objs := fhci-hcd.o fhci-hub.o fhci-q.o fhci-mem.o \ | |||
12 | ifeq ($(CONFIG_FHCI_DEBUG),y) | 12 | ifeq ($(CONFIG_FHCI_DEBUG),y) |
13 | fhci-objs += fhci-dbg.o | 13 | fhci-objs += fhci-dbg.o |
14 | endif | 14 | endif |
15 | xhci-objs := xhci-hcd.o xhci-mem.o xhci-pci.o xhci-ring.o xhci-hub.o xhci-dbg.o | 15 | xhci-hcd-objs := xhci.o xhci-mem.o xhci-pci.o xhci-ring.o xhci-hub.o xhci-dbg.o |
16 | 16 | ||
17 | obj-$(CONFIG_USB_WHCI_HCD) += whci/ | 17 | obj-$(CONFIG_USB_WHCI_HCD) += whci/ |
18 | 18 | ||
@@ -25,7 +25,7 @@ obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o | |||
25 | obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o | 25 | obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o |
26 | obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o | 26 | obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o |
27 | obj-$(CONFIG_USB_FHCI_HCD) += fhci.o | 27 | obj-$(CONFIG_USB_FHCI_HCD) += fhci.o |
28 | obj-$(CONFIG_USB_XHCI_HCD) += xhci.o | 28 | obj-$(CONFIG_USB_XHCI_HCD) += xhci-hcd.o |
29 | obj-$(CONFIG_USB_SL811_HCD) += sl811-hcd.o | 29 | obj-$(CONFIG_USB_SL811_HCD) += sl811-hcd.o |
30 | obj-$(CONFIG_USB_SL811_CS) += sl811_cs.o | 30 | obj-$(CONFIG_USB_SL811_CS) += sl811_cs.o |
31 | obj-$(CONFIG_USB_U132_HCD) += u132-hcd.o | 31 | obj-$(CONFIG_USB_U132_HCD) += u132-hcd.o |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index d8d6d3461d32..13ead00aecd5 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/ioport.h> | 24 | #include <linux/ioport.h> |
25 | #include <linux/sched.h> | 25 | #include <linux/sched.h> |
26 | #include <linux/slab.h> | ||
27 | #include <linux/vmalloc.h> | 26 | #include <linux/vmalloc.h> |
28 | #include <linux/errno.h> | 27 | #include <linux/errno.h> |
29 | #include <linux/init.h> | 28 | #include <linux/init.h> |
@@ -35,6 +34,7 @@ | |||
35 | #include <linux/moduleparam.h> | 34 | #include <linux/moduleparam.h> |
36 | #include <linux/dma-mapping.h> | 35 | #include <linux/dma-mapping.h> |
37 | #include <linux/debugfs.h> | 36 | #include <linux/debugfs.h> |
37 | #include <linux/slab.h> | ||
38 | 38 | ||
39 | #include "../core/hcd.h" | 39 | #include "../core/hcd.h" |
40 | 40 | ||
@@ -543,6 +543,7 @@ static int ehci_init(struct usb_hcd *hcd) | |||
543 | */ | 543 | */ |
544 | ehci->periodic_size = DEFAULT_I_TDPS; | 544 | ehci->periodic_size = DEFAULT_I_TDPS; |
545 | INIT_LIST_HEAD(&ehci->cached_itd_list); | 545 | INIT_LIST_HEAD(&ehci->cached_itd_list); |
546 | INIT_LIST_HEAD(&ehci->cached_sitd_list); | ||
546 | if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) | 547 | if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) |
547 | return retval; | 548 | return retval; |
548 | 549 | ||
@@ -995,7 +996,7 @@ rescan: | |||
995 | /* endpoints can be iso streams. for now, we don't | 996 | /* endpoints can be iso streams. for now, we don't |
996 | * accelerate iso completions ... so spin a while. | 997 | * accelerate iso completions ... so spin a while. |
997 | */ | 998 | */ |
998 | if (qh->hw->hw_info1 == 0) { | 999 | if (qh->hw == NULL) { |
999 | ehci_vdbg (ehci, "iso delay\n"); | 1000 | ehci_vdbg (ehci, "iso delay\n"); |
1000 | goto idle_timeout; | 1001 | goto idle_timeout; |
1001 | } | 1002 | } |
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 19372673bf09..c7178bcde67a 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
@@ -801,7 +801,7 @@ static int ehci_hub_control ( | |||
801 | * this bit; seems too long to spin routinely... | 801 | * this bit; seems too long to spin routinely... |
802 | */ | 802 | */ |
803 | retval = handshake(ehci, status_reg, | 803 | retval = handshake(ehci, status_reg, |
804 | PORT_RESET, 0, 750); | 804 | PORT_RESET, 0, 1000); |
805 | if (retval != 0) { | 805 | if (retval != 0) { |
806 | ehci_err (ehci, "port %d reset error %d\n", | 806 | ehci_err (ehci, "port %d reset error %d\n", |
807 | wIndex + 1, retval); | 807 | wIndex + 1, retval); |
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c index aeda96e0af67..1f3f01eacaf0 100644 --- a/drivers/usb/host/ehci-mem.c +++ b/drivers/usb/host/ehci-mem.c | |||
@@ -136,7 +136,7 @@ static inline void qh_put (struct ehci_qh *qh) | |||
136 | 136 | ||
137 | static void ehci_mem_cleanup (struct ehci_hcd *ehci) | 137 | static void ehci_mem_cleanup (struct ehci_hcd *ehci) |
138 | { | 138 | { |
139 | free_cached_itd_list(ehci); | 139 | free_cached_lists(ehci); |
140 | if (ehci->async) | 140 | if (ehci->async) |
141 | qh_put (ehci->async); | 141 | qh_put (ehci->async); |
142 | ehci->async = NULL; | 142 | ehci->async = NULL; |
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index 23cd917088b4..ead59f42e69b 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/usb/otg.h> | 23 | #include <linux/usb/otg.h> |
24 | #include <linux/slab.h> | ||
24 | 25 | ||
25 | #include <mach/mxc_ehci.h> | 26 | #include <mach/mxc_ehci.h> |
26 | 27 | ||
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index f0282d6bb7aa..40a858335035 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/clk.h> | 37 | #include <linux/clk.h> |
38 | #include <linux/gpio.h> | 38 | #include <linux/gpio.h> |
39 | #include <linux/regulator/consumer.h> | 39 | #include <linux/regulator/consumer.h> |
40 | #include <linux/slab.h> | ||
40 | #include <plat/usb.h> | 41 | #include <plat/usb.h> |
41 | 42 | ||
42 | /* | 43 | /* |
@@ -628,11 +629,13 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
628 | } | 629 | } |
629 | snprintf(supply, sizeof(supply), "hsusb%d", i); | 630 | snprintf(supply, sizeof(supply), "hsusb%d", i); |
630 | omap->regulator[i] = regulator_get(omap->dev, supply); | 631 | omap->regulator[i] = regulator_get(omap->dev, supply); |
631 | if (IS_ERR(omap->regulator[i])) | 632 | if (IS_ERR(omap->regulator[i])) { |
633 | omap->regulator[i] = NULL; | ||
632 | dev_dbg(&pdev->dev, | 634 | dev_dbg(&pdev->dev, |
633 | "failed to get ehci port%d regulator\n", i); | 635 | "failed to get ehci port%d regulator\n", i); |
634 | else | 636 | } else { |
635 | regulator_enable(omap->regulator[i]); | 637 | regulator_enable(omap->regulator[i]); |
638 | } | ||
636 | } | 639 | } |
637 | 640 | ||
638 | ret = omap_start_ehc(omap, hcd); | 641 | ret = omap_start_ehc(omap, hcd); |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 39340ae00ac4..805ec633a652 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -510,7 +510,7 @@ static int disable_periodic (struct ehci_hcd *ehci) | |||
510 | ehci_writel(ehci, cmd, &ehci->regs->command); | 510 | ehci_writel(ehci, cmd, &ehci->regs->command); |
511 | /* posted write ... */ | 511 | /* posted write ... */ |
512 | 512 | ||
513 | free_cached_itd_list(ehci); | 513 | free_cached_lists(ehci); |
514 | 514 | ||
515 | ehci->next_uframe = -1; | 515 | ehci->next_uframe = -1; |
516 | return 0; | 516 | return 0; |
@@ -1123,8 +1123,8 @@ iso_stream_find (struct ehci_hcd *ehci, struct urb *urb) | |||
1123 | urb->interval); | 1123 | urb->interval); |
1124 | } | 1124 | } |
1125 | 1125 | ||
1126 | /* if dev->ep [epnum] is a QH, info1.maxpacket is nonzero */ | 1126 | /* if dev->ep [epnum] is a QH, hw is set */ |
1127 | } else if (unlikely (stream->hw_info1 != 0)) { | 1127 | } else if (unlikely (stream->hw != NULL)) { |
1128 | ehci_dbg (ehci, "dev %s ep%d%s, not iso??\n", | 1128 | ehci_dbg (ehci, "dev %s ep%d%s, not iso??\n", |
1129 | urb->dev->devpath, epnum, | 1129 | urb->dev->devpath, epnum, |
1130 | usb_pipein(urb->pipe) ? "in" : "out"); | 1130 | usb_pipein(urb->pipe) ? "in" : "out"); |
@@ -1565,13 +1565,27 @@ itd_patch( | |||
1565 | static inline void | 1565 | static inline void |
1566 | itd_link (struct ehci_hcd *ehci, unsigned frame, struct ehci_itd *itd) | 1566 | itd_link (struct ehci_hcd *ehci, unsigned frame, struct ehci_itd *itd) |
1567 | { | 1567 | { |
1568 | /* always prepend ITD/SITD ... only QH tree is order-sensitive */ | 1568 | union ehci_shadow *prev = &ehci->pshadow[frame]; |
1569 | itd->itd_next = ehci->pshadow [frame]; | 1569 | __hc32 *hw_p = &ehci->periodic[frame]; |
1570 | itd->hw_next = ehci->periodic [frame]; | 1570 | union ehci_shadow here = *prev; |
1571 | ehci->pshadow [frame].itd = itd; | 1571 | __hc32 type = 0; |
1572 | |||
1573 | /* skip any iso nodes which might belong to previous microframes */ | ||
1574 | while (here.ptr) { | ||
1575 | type = Q_NEXT_TYPE(ehci, *hw_p); | ||
1576 | if (type == cpu_to_hc32(ehci, Q_TYPE_QH)) | ||
1577 | break; | ||
1578 | prev = periodic_next_shadow(ehci, prev, type); | ||
1579 | hw_p = shadow_next_periodic(ehci, &here, type); | ||
1580 | here = *prev; | ||
1581 | } | ||
1582 | |||
1583 | itd->itd_next = here; | ||
1584 | itd->hw_next = *hw_p; | ||
1585 | prev->itd = itd; | ||
1572 | itd->frame = frame; | 1586 | itd->frame = frame; |
1573 | wmb (); | 1587 | wmb (); |
1574 | ehci->periodic[frame] = cpu_to_hc32(ehci, itd->itd_dma | Q_TYPE_ITD); | 1588 | *hw_p = cpu_to_hc32(ehci, itd->itd_dma | Q_TYPE_ITD); |
1575 | } | 1589 | } |
1576 | 1590 | ||
1577 | /* fit urb's itds into the selected schedule slot; activate as needed */ | 1591 | /* fit urb's itds into the selected schedule slot; activate as needed */ |
@@ -2125,13 +2139,27 @@ sitd_complete ( | |||
2125 | (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out"); | 2139 | (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out"); |
2126 | } | 2140 | } |
2127 | iso_stream_put (ehci, stream); | 2141 | iso_stream_put (ehci, stream); |
2128 | /* OK to recycle this SITD now that its completion callback ran. */ | 2142 | |
2129 | done: | 2143 | done: |
2130 | sitd->urb = NULL; | 2144 | sitd->urb = NULL; |
2131 | sitd->stream = NULL; | 2145 | if (ehci->clock_frame != sitd->frame) { |
2132 | list_move(&sitd->sitd_list, &stream->free_list); | 2146 | /* OK to recycle this SITD now. */ |
2133 | iso_stream_put(ehci, stream); | 2147 | sitd->stream = NULL; |
2134 | 2148 | list_move(&sitd->sitd_list, &stream->free_list); | |
2149 | iso_stream_put(ehci, stream); | ||
2150 | } else { | ||
2151 | /* HW might remember this SITD, so we can't recycle it yet. | ||
2152 | * Move it to a safe place until a new frame starts. | ||
2153 | */ | ||
2154 | list_move(&sitd->sitd_list, &ehci->cached_sitd_list); | ||
2155 | if (stream->refcount == 2) { | ||
2156 | /* If iso_stream_put() were called here, stream | ||
2157 | * would be freed. Instead, just prevent reuse. | ||
2158 | */ | ||
2159 | stream->ep->hcpriv = NULL; | ||
2160 | stream->ep = NULL; | ||
2161 | } | ||
2162 | } | ||
2135 | return retval; | 2163 | return retval; |
2136 | } | 2164 | } |
2137 | 2165 | ||
@@ -2197,9 +2225,10 @@ done: | |||
2197 | 2225 | ||
2198 | /*-------------------------------------------------------------------------*/ | 2226 | /*-------------------------------------------------------------------------*/ |
2199 | 2227 | ||
2200 | static void free_cached_itd_list(struct ehci_hcd *ehci) | 2228 | static void free_cached_lists(struct ehci_hcd *ehci) |
2201 | { | 2229 | { |
2202 | struct ehci_itd *itd, *n; | 2230 | struct ehci_itd *itd, *n; |
2231 | struct ehci_sitd *sitd, *sn; | ||
2203 | 2232 | ||
2204 | list_for_each_entry_safe(itd, n, &ehci->cached_itd_list, itd_list) { | 2233 | list_for_each_entry_safe(itd, n, &ehci->cached_itd_list, itd_list) { |
2205 | struct ehci_iso_stream *stream = itd->stream; | 2234 | struct ehci_iso_stream *stream = itd->stream; |
@@ -2207,6 +2236,13 @@ static void free_cached_itd_list(struct ehci_hcd *ehci) | |||
2207 | list_move(&itd->itd_list, &stream->free_list); | 2236 | list_move(&itd->itd_list, &stream->free_list); |
2208 | iso_stream_put(ehci, stream); | 2237 | iso_stream_put(ehci, stream); |
2209 | } | 2238 | } |
2239 | |||
2240 | list_for_each_entry_safe(sitd, sn, &ehci->cached_sitd_list, sitd_list) { | ||
2241 | struct ehci_iso_stream *stream = sitd->stream; | ||
2242 | sitd->stream = NULL; | ||
2243 | list_move(&sitd->sitd_list, &stream->free_list); | ||
2244 | iso_stream_put(ehci, stream); | ||
2245 | } | ||
2210 | } | 2246 | } |
2211 | 2247 | ||
2212 | /*-------------------------------------------------------------------------*/ | 2248 | /*-------------------------------------------------------------------------*/ |
@@ -2233,7 +2269,7 @@ scan_periodic (struct ehci_hcd *ehci) | |||
2233 | clock_frame = -1; | 2269 | clock_frame = -1; |
2234 | } | 2270 | } |
2235 | if (ehci->clock_frame != clock_frame) { | 2271 | if (ehci->clock_frame != clock_frame) { |
2236 | free_cached_itd_list(ehci); | 2272 | free_cached_lists(ehci); |
2237 | ehci->clock_frame = clock_frame; | 2273 | ehci->clock_frame = clock_frame; |
2238 | } | 2274 | } |
2239 | clock %= mod; | 2275 | clock %= mod; |
@@ -2400,7 +2436,7 @@ restart: | |||
2400 | clock = now; | 2436 | clock = now; |
2401 | clock_frame = clock >> 3; | 2437 | clock_frame = clock >> 3; |
2402 | if (ehci->clock_frame != clock_frame) { | 2438 | if (ehci->clock_frame != clock_frame) { |
2403 | free_cached_itd_list(ehci); | 2439 | free_cached_lists(ehci); |
2404 | ehci->clock_frame = clock_frame; | 2440 | ehci->clock_frame = clock_frame; |
2405 | } | 2441 | } |
2406 | } else { | 2442 | } else { |
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 2d85e21ff282..556c0b48f3ab 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -87,8 +87,9 @@ struct ehci_hcd { /* one per controller */ | |||
87 | int next_uframe; /* scan periodic, start here */ | 87 | int next_uframe; /* scan periodic, start here */ |
88 | unsigned periodic_sched; /* periodic activity count */ | 88 | unsigned periodic_sched; /* periodic activity count */ |
89 | 89 | ||
90 | /* list of itds completed while clock_frame was still active */ | 90 | /* list of itds & sitds completed while clock_frame was still active */ |
91 | struct list_head cached_itd_list; | 91 | struct list_head cached_itd_list; |
92 | struct list_head cached_sitd_list; | ||
92 | unsigned clock_frame; | 93 | unsigned clock_frame; |
93 | 94 | ||
94 | /* per root hub port */ | 95 | /* per root hub port */ |
@@ -195,7 +196,7 @@ timer_action_done (struct ehci_hcd *ehci, enum ehci_timer_action action) | |||
195 | clear_bit (action, &ehci->actions); | 196 | clear_bit (action, &ehci->actions); |
196 | } | 197 | } |
197 | 198 | ||
198 | static void free_cached_itd_list(struct ehci_hcd *ehci); | 199 | static void free_cached_lists(struct ehci_hcd *ehci); |
199 | 200 | ||
200 | /*-------------------------------------------------------------------------*/ | 201 | /*-------------------------------------------------------------------------*/ |
201 | 202 | ||
@@ -394,9 +395,8 @@ struct ehci_iso_sched { | |||
394 | * acts like a qh would, if EHCI had them for ISO. | 395 | * acts like a qh would, if EHCI had them for ISO. |
395 | */ | 396 | */ |
396 | struct ehci_iso_stream { | 397 | struct ehci_iso_stream { |
397 | /* first two fields match QH, but info1 == 0 */ | 398 | /* first field matches ehci_hq, but is NULL */ |
398 | __hc32 hw_next; | 399 | struct ehci_qh_hw *hw; |
399 | __hc32 hw_info1; | ||
400 | 400 | ||
401 | u32 refcount; | 401 | u32 refcount; |
402 | u8 bEndpointAddress; | 402 | u8 bEndpointAddress; |
diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c index 5dcfb3de9945..15379c636143 100644 --- a/drivers/usb/host/fhci-hcd.c +++ b/drivers/usb/host/fhci-hcd.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/usb.h> | 27 | #include <linux/usb.h> |
28 | #include <linux/of_platform.h> | 28 | #include <linux/of_platform.h> |
29 | #include <linux/of_gpio.h> | 29 | #include <linux/of_gpio.h> |
30 | #include <linux/slab.h> | ||
30 | #include <asm/qe.h> | 31 | #include <asm/qe.h> |
31 | #include <asm/fsl_gtm.h> | 32 | #include <asm/fsl_gtm.h> |
32 | #include "../core/hcd.h" | 33 | #include "../core/hcd.h" |
diff --git a/drivers/usb/host/fhci-mem.c b/drivers/usb/host/fhci-mem.c index 2c0736c99712..5591bfb499d1 100644 --- a/drivers/usb/host/fhci-mem.c +++ b/drivers/usb/host/fhci-mem.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
21 | #include <linux/slab.h> | ||
21 | #include <linux/list.h> | 22 | #include <linux/list.h> |
22 | #include <linux/usb.h> | 23 | #include <linux/usb.h> |
23 | #include "../core/hcd.h" | 24 | #include "../core/hcd.h" |
diff --git a/drivers/usb/host/fhci-q.c b/drivers/usb/host/fhci-q.c index b0a1446ba292..f73c92359beb 100644 --- a/drivers/usb/host/fhci-q.c +++ b/drivers/usb/host/fhci-q.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
21 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
22 | #include <linux/slab.h> | ||
22 | #include <linux/list.h> | 23 | #include <linux/list.h> |
23 | #include <linux/usb.h> | 24 | #include <linux/usb.h> |
24 | #include "../core/hcd.h" | 25 | #include "../core/hcd.h" |
diff --git a/drivers/usb/host/fhci-tds.c b/drivers/usb/host/fhci-tds.c index e1232890c78b..57013479d7f7 100644 --- a/drivers/usb/host/fhci-tds.c +++ b/drivers/usb/host/fhci-tds.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/errno.h> | 20 | #include <linux/errno.h> |
21 | #include <linux/slab.h> | ||
21 | #include <linux/list.h> | 22 | #include <linux/list.h> |
22 | #include <linux/io.h> | 23 | #include <linux/io.h> |
23 | #include <linux/usb.h> | 24 | #include <linux/usb.h> |
diff --git a/drivers/usb/host/hwa-hc.c b/drivers/usb/host/hwa-hc.c index 88b03214622b..35742f8c7cda 100644 --- a/drivers/usb/host/hwa-hc.c +++ b/drivers/usb/host/hwa-hc.c | |||
@@ -55,6 +55,7 @@ | |||
55 | */ | 55 | */ |
56 | #include <linux/kernel.h> | 56 | #include <linux/kernel.h> |
57 | #include <linux/init.h> | 57 | #include <linux/init.h> |
58 | #include <linux/slab.h> | ||
58 | #include <linux/module.h> | 59 | #include <linux/module.h> |
59 | #include <linux/workqueue.h> | 60 | #include <linux/workqueue.h> |
60 | #include <linux/wait.h> | 61 | #include <linux/wait.h> |
diff --git a/drivers/usb/host/imx21-hcd.c b/drivers/usb/host/imx21-hcd.c index 213e270e1c29..8a12f297645f 100644 --- a/drivers/usb/host/imx21-hcd.c +++ b/drivers/usb/host/imx21-hcd.c | |||
@@ -54,6 +54,7 @@ | |||
54 | #include <linux/kernel.h> | 54 | #include <linux/kernel.h> |
55 | #include <linux/list.h> | 55 | #include <linux/list.h> |
56 | #include <linux/platform_device.h> | 56 | #include <linux/platform_device.h> |
57 | #include <linux/slab.h> | ||
57 | #include <linux/usb.h> | 58 | #include <linux/usb.h> |
58 | 59 | ||
59 | #include "../core/hcd.h" | 60 | #include "../core/hcd.h" |
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index a2b305477afe..92de71dc7729 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c | |||
@@ -62,6 +62,7 @@ | |||
62 | #include <linux/errno.h> | 62 | #include <linux/errno.h> |
63 | #include <linux/init.h> | 63 | #include <linux/init.h> |
64 | #include <linux/list.h> | 64 | #include <linux/list.h> |
65 | #include <linux/slab.h> | ||
65 | #include <linux/usb.h> | 66 | #include <linux/usb.h> |
66 | #include <linux/usb/isp116x.h> | 67 | #include <linux/usb/isp116x.h> |
67 | #include <linux/platform_device.h> | 68 | #include <linux/platform_device.h> |
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 68b83ab70719..944291e10f97 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c | |||
@@ -331,6 +331,8 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) | |||
331 | */ | 331 | */ |
332 | if (at91_suspend_entering_slow_clock()) { | 332 | if (at91_suspend_entering_slow_clock()) { |
333 | ohci_usb_reset (ohci); | 333 | ohci_usb_reset (ohci); |
334 | /* flush the writes */ | ||
335 | (void) ohci_readl (ohci, &ohci->regs->control); | ||
334 | at91_stop_clock(); | 336 | at91_stop_clock(); |
335 | } | 337 | } |
336 | 338 | ||
diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index 4aa08d36d077..d22fb4d577b7 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #error "This file is DA8xx bus glue. Define CONFIG_ARCH_DAVINCI_DA8XX." | 23 | #error "This file is DA8xx bus glue. Define CONFIG_ARCH_DAVINCI_DA8XX." |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | #define CFGCHIP2 DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP2_REG) | 26 | #define CFGCHIP2 DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG) |
27 | 27 | ||
28 | static struct clk *usb11_clk; | 28 | static struct clk *usb11_clk; |
29 | static struct clk *usb20_clk; | 29 | static struct clk *usb20_clk; |
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index 32bbce9718f0..65cac8cc8921 100644 --- a/drivers/usb/host/ohci-hub.c +++ b/drivers/usb/host/ohci-hub.c | |||
@@ -697,7 +697,7 @@ static int ohci_hub_control ( | |||
697 | u16 wLength | 697 | u16 wLength |
698 | ) { | 698 | ) { |
699 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | 699 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); |
700 | int ports = hcd_to_bus (hcd)->root_hub->maxchild; | 700 | int ports = ohci->num_ports; |
701 | u32 temp; | 701 | u32 temp; |
702 | int retval = 0; | 702 | int retval = 0; |
703 | 703 | ||
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c index 35288bcae0db..83094d067e0f 100644 --- a/drivers/usb/host/ohci-q.c +++ b/drivers/usb/host/ohci-q.c | |||
@@ -8,6 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/irq.h> | 10 | #include <linux/irq.h> |
11 | #include <linux/slab.h> | ||
11 | 12 | ||
12 | static void urb_free_priv (struct ohci_hcd *hc, urb_priv_t *urb_priv) | 13 | static void urb_free_priv (struct ohci_hcd *hc, urb_priv_t *urb_priv) |
13 | { | 14 | { |
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c index 50f57f468836..e62b30b3e429 100644 --- a/drivers/usb/host/oxu210hp-hcd.c +++ b/drivers/usb/host/oxu210hp-hcd.c | |||
@@ -660,13 +660,13 @@ static struct ehci_qh *oxu_qh_alloc(struct oxu_hcd *oxu) | |||
660 | if (qh->dummy == NULL) { | 660 | if (qh->dummy == NULL) { |
661 | oxu_dbg(oxu, "no dummy td\n"); | 661 | oxu_dbg(oxu, "no dummy td\n"); |
662 | oxu->qh_used[i] = 0; | 662 | oxu->qh_used[i] = 0; |
663 | 663 | qh = NULL; | |
664 | return NULL; | 664 | goto unlock; |
665 | } | 665 | } |
666 | 666 | ||
667 | oxu->qh_used[i] = 1; | 667 | oxu->qh_used[i] = 1; |
668 | } | 668 | } |
669 | 669 | unlock: | |
670 | spin_unlock(&oxu->mem_lock); | 670 | spin_unlock(&oxu->mem_lock); |
671 | 671 | ||
672 | return qh; | 672 | return qh; |
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index bee558aed427..d478ffad59b4 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/io.h> | 37 | #include <linux/io.h> |
38 | #include <linux/mm.h> | 38 | #include <linux/mm.h> |
39 | #include <linux/irq.h> | 39 | #include <linux/irq.h> |
40 | #include <linux/slab.h> | ||
40 | #include <asm/cacheflush.h> | 41 | #include <asm/cacheflush.h> |
41 | 42 | ||
42 | #include "../core/hcd.h" | 43 | #include "../core/hcd.h" |
@@ -418,7 +419,7 @@ static u8 alloc_usb_address(struct r8a66597 *r8a66597, struct urb *urb) | |||
418 | 419 | ||
419 | /* this function must be called with interrupt disabled */ | 420 | /* this function must be called with interrupt disabled */ |
420 | static void free_usb_address(struct r8a66597 *r8a66597, | 421 | static void free_usb_address(struct r8a66597 *r8a66597, |
421 | struct r8a66597_device *dev) | 422 | struct r8a66597_device *dev, int reset) |
422 | { | 423 | { |
423 | int port; | 424 | int port; |
424 | 425 | ||
@@ -430,7 +431,13 @@ static void free_usb_address(struct r8a66597 *r8a66597, | |||
430 | dev->state = USB_STATE_DEFAULT; | 431 | dev->state = USB_STATE_DEFAULT; |
431 | r8a66597->address_map &= ~(1 << dev->address); | 432 | r8a66597->address_map &= ~(1 << dev->address); |
432 | dev->address = 0; | 433 | dev->address = 0; |
433 | dev_set_drvdata(&dev->udev->dev, NULL); | 434 | /* |
435 | * Only when resetting USB, it is necessary to erase drvdata. When | ||
436 | * a usb device with usb hub is disconnect, "dev->udev" is already | ||
437 | * freed on usb_desconnect(). So we cannot access the data. | ||
438 | */ | ||
439 | if (reset) | ||
440 | dev_set_drvdata(&dev->udev->dev, NULL); | ||
434 | list_del(&dev->device_list); | 441 | list_del(&dev->device_list); |
435 | kfree(dev); | 442 | kfree(dev); |
436 | 443 | ||
@@ -1069,7 +1076,7 @@ static void r8a66597_usb_disconnect(struct r8a66597 *r8a66597, int port) | |||
1069 | struct r8a66597_device *dev = r8a66597->root_hub[port].dev; | 1076 | struct r8a66597_device *dev = r8a66597->root_hub[port].dev; |
1070 | 1077 | ||
1071 | disable_r8a66597_pipe_all(r8a66597, dev); | 1078 | disable_r8a66597_pipe_all(r8a66597, dev); |
1072 | free_usb_address(r8a66597, dev); | 1079 | free_usb_address(r8a66597, dev, 0); |
1073 | 1080 | ||
1074 | start_root_hub_sampling(r8a66597, port, 0); | 1081 | start_root_hub_sampling(r8a66597, port, 0); |
1075 | } | 1082 | } |
@@ -2085,7 +2092,7 @@ static void update_usb_address_map(struct r8a66597 *r8a66597, | |||
2085 | spin_lock_irqsave(&r8a66597->lock, flags); | 2092 | spin_lock_irqsave(&r8a66597->lock, flags); |
2086 | dev = get_r8a66597_device(r8a66597, addr); | 2093 | dev = get_r8a66597_device(r8a66597, addr); |
2087 | disable_r8a66597_pipe_all(r8a66597, dev); | 2094 | disable_r8a66597_pipe_all(r8a66597, dev); |
2088 | free_usb_address(r8a66597, dev); | 2095 | free_usb_address(r8a66597, dev, 0); |
2089 | put_child_connect_map(r8a66597, addr); | 2096 | put_child_connect_map(r8a66597, addr); |
2090 | spin_unlock_irqrestore(&r8a66597->lock, flags); | 2097 | spin_unlock_irqrestore(&r8a66597->lock, flags); |
2091 | } | 2098 | } |
@@ -2228,7 +2235,7 @@ static int r8a66597_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
2228 | rh->port |= (1 << USB_PORT_FEAT_RESET); | 2235 | rh->port |= (1 << USB_PORT_FEAT_RESET); |
2229 | 2236 | ||
2230 | disable_r8a66597_pipe_all(r8a66597, dev); | 2237 | disable_r8a66597_pipe_all(r8a66597, dev); |
2231 | free_usb_address(r8a66597, dev); | 2238 | free_usb_address(r8a66597, dev, 1); |
2232 | 2239 | ||
2233 | r8a66597_mdfy(r8a66597, USBRST, USBRST | UACT, | 2240 | r8a66597_mdfy(r8a66597, USBRST, USBRST | UACT, |
2234 | get_dvstctr_reg(port)); | 2241 | get_dvstctr_reg(port)); |
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index e11cc3aa4b82..3b867a8af7b2 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c | |||
@@ -720,10 +720,10 @@ retry: | |||
720 | /* port status seems weird until after reset, so | 720 | /* port status seems weird until after reset, so |
721 | * force the reset and make khubd clean up later. | 721 | * force the reset and make khubd clean up later. |
722 | */ | 722 | */ |
723 | if (sl811->stat_insrmv & 1) | 723 | if (irqstat & SL11H_INTMASK_RD) |
724 | sl811->port1 |= 1 << USB_PORT_FEAT_CONNECTION; | ||
725 | else | ||
726 | sl811->port1 &= ~(1 << USB_PORT_FEAT_CONNECTION); | 724 | sl811->port1 &= ~(1 << USB_PORT_FEAT_CONNECTION); |
725 | else | ||
726 | sl811->port1 |= 1 << USB_PORT_FEAT_CONNECTION; | ||
727 | 727 | ||
728 | sl811->port1 |= 1 << USB_PORT_FEAT_C_CONNECTION; | 728 | sl811->port1 |= 1 << USB_PORT_FEAT_C_CONNECTION; |
729 | 729 | ||
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index e52b954dda47..98cf0b26b968 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c | |||
@@ -9,6 +9,7 @@ | |||
9 | * (C) Copyright 1999-2001 Johannes Erdfelt | 9 | * (C) Copyright 1999-2001 Johannes Erdfelt |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/slab.h> | ||
12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
13 | #include <linux/debugfs.h> | 14 | #include <linux/debugfs.h> |
14 | #include <linux/smp_lock.h> | 15 | #include <linux/smp_lock.h> |
diff --git a/drivers/usb/host/whci/asl.c b/drivers/usb/host/whci/asl.c index 562eba108816..773249306031 100644 --- a/drivers/usb/host/whci/asl.c +++ b/drivers/usb/host/whci/asl.c | |||
@@ -16,6 +16,7 @@ | |||
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | */ | 17 | */ |
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/gfp.h> | ||
19 | #include <linux/dma-mapping.h> | 20 | #include <linux/dma-mapping.h> |
20 | #include <linux/uwb/umc.h> | 21 | #include <linux/uwb/umc.h> |
21 | #include <linux/usb.h> | 22 | #include <linux/usb.h> |
diff --git a/drivers/usb/host/whci/debug.c b/drivers/usb/host/whci/debug.c index 8c1c610c9513..c5305b599ca0 100644 --- a/drivers/usb/host/whci/debug.c +++ b/drivers/usb/host/whci/debug.c | |||
@@ -15,6 +15,7 @@ | |||
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | */ | 17 | */ |
18 | #include <linux/slab.h> | ||
18 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
19 | #include <linux/debugfs.h> | 20 | #include <linux/debugfs.h> |
20 | #include <linux/seq_file.h> | 21 | #include <linux/seq_file.h> |
diff --git a/drivers/usb/host/whci/init.c b/drivers/usb/host/whci/init.c index 34a783cb0133..f7582e8e2169 100644 --- a/drivers/usb/host/whci/init.c +++ b/drivers/usb/host/whci/init.c | |||
@@ -16,6 +16,7 @@ | |||
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | */ | 17 | */ |
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/gfp.h> | ||
19 | #include <linux/dma-mapping.h> | 20 | #include <linux/dma-mapping.h> |
20 | #include <linux/uwb/umc.h> | 21 | #include <linux/uwb/umc.h> |
21 | 22 | ||
diff --git a/drivers/usb/host/whci/pzl.c b/drivers/usb/host/whci/pzl.c index 0db3fb2dc03a..33c5580b4d25 100644 --- a/drivers/usb/host/whci/pzl.c +++ b/drivers/usb/host/whci/pzl.c | |||
@@ -16,6 +16,7 @@ | |||
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | */ | 17 | */ |
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/gfp.h> | ||
19 | #include <linux/dma-mapping.h> | 20 | #include <linux/dma-mapping.h> |
20 | #include <linux/uwb/umc.h> | 21 | #include <linux/uwb/umc.h> |
21 | #include <linux/usb.h> | 22 | #include <linux/usb.h> |
diff --git a/drivers/usb/host/whci/qset.c b/drivers/usb/host/whci/qset.c index 7d4204db0f61..141d049beb3e 100644 --- a/drivers/usb/host/whci/qset.c +++ b/drivers/usb/host/whci/qset.c | |||
@@ -17,6 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/dma-mapping.h> | 19 | #include <linux/dma-mapping.h> |
20 | #include <linux/slab.h> | ||
20 | #include <linux/uwb/umc.h> | 21 | #include <linux/uwb/umc.h> |
21 | #include <linux/usb.h> | 22 | #include <linux/usb.h> |
22 | 23 | ||
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 49f7d72f8b1b..d64f5724bfc4 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <linux/usb.h> | 23 | #include <linux/usb.h> |
24 | #include <linux/pci.h> | 24 | #include <linux/pci.h> |
25 | #include <linux/slab.h> | ||
25 | #include <linux/dmapool.h> | 26 | #include <linux/dmapool.h> |
26 | 27 | ||
27 | #include "xhci.h" | 28 | #include "xhci.h" |
@@ -566,8 +567,13 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev, | |||
566 | if (interval < 3) | 567 | if (interval < 3) |
567 | interval = 3; | 568 | interval = 3; |
568 | if ((1 << interval) != 8*ep->desc.bInterval) | 569 | if ((1 << interval) != 8*ep->desc.bInterval) |
569 | dev_warn(&udev->dev, "ep %#x - rounding interval to %d microframes\n", | 570 | dev_warn(&udev->dev, |
570 | ep->desc.bEndpointAddress, 1 << interval); | 571 | "ep %#x - rounding interval" |
572 | " to %d microframes, " | ||
573 | "ep desc says %d microframes\n", | ||
574 | ep->desc.bEndpointAddress, | ||
575 | 1 << interval, | ||
576 | 8*ep->desc.bInterval); | ||
571 | } | 577 | } |
572 | break; | 578 | break; |
573 | default: | 579 | default: |
@@ -576,6 +582,19 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev, | |||
576 | return EP_INTERVAL(interval); | 582 | return EP_INTERVAL(interval); |
577 | } | 583 | } |
578 | 584 | ||
585 | /* The "Mult" field in the endpoint context is only set for SuperSpeed devices. | ||
586 | * High speed endpoint descriptors can define "the number of additional | ||
587 | * transaction opportunities per microframe", but that goes in the Max Burst | ||
588 | * endpoint context field. | ||
589 | */ | ||
590 | static inline u32 xhci_get_endpoint_mult(struct usb_device *udev, | ||
591 | struct usb_host_endpoint *ep) | ||
592 | { | ||
593 | if (udev->speed != USB_SPEED_SUPER || !ep->ss_ep_comp) | ||
594 | return 0; | ||
595 | return ep->ss_ep_comp->desc.bmAttributes; | ||
596 | } | ||
597 | |||
579 | static inline u32 xhci_get_endpoint_type(struct usb_device *udev, | 598 | static inline u32 xhci_get_endpoint_type(struct usb_device *udev, |
580 | struct usb_host_endpoint *ep) | 599 | struct usb_host_endpoint *ep) |
581 | { | 600 | { |
@@ -606,6 +625,36 @@ static inline u32 xhci_get_endpoint_type(struct usb_device *udev, | |||
606 | return type; | 625 | return type; |
607 | } | 626 | } |
608 | 627 | ||
628 | /* Return the maximum endpoint service interval time (ESIT) payload. | ||
629 | * Basically, this is the maxpacket size, multiplied by the burst size | ||
630 | * and mult size. | ||
631 | */ | ||
632 | static inline u32 xhci_get_max_esit_payload(struct xhci_hcd *xhci, | ||
633 | struct usb_device *udev, | ||
634 | struct usb_host_endpoint *ep) | ||
635 | { | ||
636 | int max_burst; | ||
637 | int max_packet; | ||
638 | |||
639 | /* Only applies for interrupt or isochronous endpoints */ | ||
640 | if (usb_endpoint_xfer_control(&ep->desc) || | ||
641 | usb_endpoint_xfer_bulk(&ep->desc)) | ||
642 | return 0; | ||
643 | |||
644 | if (udev->speed == USB_SPEED_SUPER) { | ||
645 | if (ep->ss_ep_comp) | ||
646 | return ep->ss_ep_comp->desc.wBytesPerInterval; | ||
647 | xhci_warn(xhci, "WARN no SS endpoint companion descriptor.\n"); | ||
648 | /* Assume no bursts, no multiple opportunities to send. */ | ||
649 | return ep->desc.wMaxPacketSize; | ||
650 | } | ||
651 | |||
652 | max_packet = ep->desc.wMaxPacketSize & 0x3ff; | ||
653 | max_burst = (ep->desc.wMaxPacketSize & 0x1800) >> 11; | ||
654 | /* A 0 in max burst means 1 transfer per ESIT */ | ||
655 | return max_packet * (max_burst + 1); | ||
656 | } | ||
657 | |||
609 | int xhci_endpoint_init(struct xhci_hcd *xhci, | 658 | int xhci_endpoint_init(struct xhci_hcd *xhci, |
610 | struct xhci_virt_device *virt_dev, | 659 | struct xhci_virt_device *virt_dev, |
611 | struct usb_device *udev, | 660 | struct usb_device *udev, |
@@ -617,6 +666,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
617 | struct xhci_ring *ep_ring; | 666 | struct xhci_ring *ep_ring; |
618 | unsigned int max_packet; | 667 | unsigned int max_packet; |
619 | unsigned int max_burst; | 668 | unsigned int max_burst; |
669 | u32 max_esit_payload; | ||
620 | 670 | ||
621 | ep_index = xhci_get_endpoint_index(&ep->desc); | 671 | ep_index = xhci_get_endpoint_index(&ep->desc); |
622 | ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); | 672 | ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); |
@@ -638,6 +688,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
638 | ep_ctx->deq = ep_ring->first_seg->dma | ep_ring->cycle_state; | 688 | ep_ctx->deq = ep_ring->first_seg->dma | ep_ring->cycle_state; |
639 | 689 | ||
640 | ep_ctx->ep_info = xhci_get_endpoint_interval(udev, ep); | 690 | ep_ctx->ep_info = xhci_get_endpoint_interval(udev, ep); |
691 | ep_ctx->ep_info |= EP_MULT(xhci_get_endpoint_mult(udev, ep)); | ||
641 | 692 | ||
642 | /* FIXME dig Mult and streams info out of ep companion desc */ | 693 | /* FIXME dig Mult and streams info out of ep companion desc */ |
643 | 694 | ||
@@ -683,6 +734,26 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
683 | default: | 734 | default: |
684 | BUG(); | 735 | BUG(); |
685 | } | 736 | } |
737 | max_esit_payload = xhci_get_max_esit_payload(xhci, udev, ep); | ||
738 | ep_ctx->tx_info = MAX_ESIT_PAYLOAD_FOR_EP(max_esit_payload); | ||
739 | |||
740 | /* | ||
741 | * XXX no idea how to calculate the average TRB buffer length for bulk | ||
742 | * endpoints, as the driver gives us no clue how big each scatter gather | ||
743 | * list entry (or buffer) is going to be. | ||
744 | * | ||
745 | * For isochronous and interrupt endpoints, we set it to the max | ||
746 | * available, until we have new API in the USB core to allow drivers to | ||
747 | * declare how much bandwidth they actually need. | ||
748 | * | ||
749 | * Normally, it would be calculated by taking the total of the buffer | ||
750 | * lengths in the TD and then dividing by the number of TRBs in a TD, | ||
751 | * including link TRBs, No-op TRBs, and Event data TRBs. Since we don't | ||
752 | * use Event Data TRBs, and we don't chain in a link TRB on short | ||
753 | * transfers, we're basically dividing by 1. | ||
754 | */ | ||
755 | ep_ctx->tx_info |= AVG_TRB_LENGTH_FOR_EP(max_esit_payload); | ||
756 | |||
686 | /* FIXME Debug endpoint context */ | 757 | /* FIXME Debug endpoint context */ |
687 | return 0; | 758 | return 0; |
688 | } | 759 | } |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 6ba841bca4a2..85d7e8f2085e 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -65,6 +65,7 @@ | |||
65 | */ | 65 | */ |
66 | 66 | ||
67 | #include <linux/scatterlist.h> | 67 | #include <linux/scatterlist.h> |
68 | #include <linux/slab.h> | ||
68 | #include "xhci.h" | 69 | #include "xhci.h" |
69 | 70 | ||
70 | /* | 71 | /* |
diff --git a/drivers/usb/host/xhci-hcd.c b/drivers/usb/host/xhci.c index 4cb69e0af834..7e4277273908 100644 --- a/drivers/usb/host/xhci-hcd.c +++ b/drivers/usb/host/xhci.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/irq.h> | 23 | #include <linux/irq.h> |
24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
25 | #include <linux/moduleparam.h> | 25 | #include <linux/moduleparam.h> |
26 | #include <linux/slab.h> | ||
26 | 27 | ||
27 | #include "xhci.h" | 28 | #include "xhci.h" |
28 | 29 | ||
@@ -1173,6 +1174,7 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci, | |||
1173 | cmd_completion = &virt_dev->cmd_completion; | 1174 | cmd_completion = &virt_dev->cmd_completion; |
1174 | cmd_status = &virt_dev->cmd_status; | 1175 | cmd_status = &virt_dev->cmd_status; |
1175 | } | 1176 | } |
1177 | init_completion(cmd_completion); | ||
1176 | 1178 | ||
1177 | if (!ctx_change) | 1179 | if (!ctx_change) |
1178 | ret = xhci_queue_configure_endpoint(xhci, in_ctx->dma, | 1180 | ret = xhci_queue_configure_endpoint(xhci, in_ctx->dma, |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index e5eb09b2f38e..ea389e9a4931 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -609,6 +609,10 @@ struct xhci_ep_ctx { | |||
609 | #define MAX_PACKET_MASK (0xffff << 16) | 609 | #define MAX_PACKET_MASK (0xffff << 16) |
610 | #define MAX_PACKET_DECODED(p) (((p) >> 16) & 0xffff) | 610 | #define MAX_PACKET_DECODED(p) (((p) >> 16) & 0xffff) |
611 | 611 | ||
612 | /* tx_info bitmasks */ | ||
613 | #define AVG_TRB_LENGTH_FOR_EP(p) ((p) & 0xffff) | ||
614 | #define MAX_ESIT_PAYLOAD_FOR_EP(p) (((p) & 0xffff) << 16) | ||
615 | |||
612 | 616 | ||
613 | /** | 617 | /** |
614 | * struct xhci_input_control_context | 618 | * struct xhci_input_control_context |
diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index 4d2952f1fb13..094f91cbc578 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/errno.h> | 24 | #include <linux/errno.h> |
25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/slab.h> | ||
27 | #include <linux/usb.h> | 28 | #include <linux/usb.h> |
28 | #include <linux/backlight.h> | 29 | #include <linux/backlight.h> |
29 | #include <linux/timer.h> | 30 | #include <linux/timer.h> |
@@ -202,6 +203,7 @@ static void appledisplay_work(struct work_struct *work) | |||
202 | static int appledisplay_probe(struct usb_interface *iface, | 203 | static int appledisplay_probe(struct usb_interface *iface, |
203 | const struct usb_device_id *id) | 204 | const struct usb_device_id *id) |
204 | { | 205 | { |
206 | struct backlight_properties props; | ||
205 | struct appledisplay *pdata; | 207 | struct appledisplay *pdata; |
206 | struct usb_device *udev = interface_to_usbdev(iface); | 208 | struct usb_device *udev = interface_to_usbdev(iface); |
207 | struct usb_host_interface *iface_desc; | 209 | struct usb_host_interface *iface_desc; |
@@ -279,16 +281,16 @@ static int appledisplay_probe(struct usb_interface *iface, | |||
279 | /* Register backlight device */ | 281 | /* Register backlight device */ |
280 | snprintf(bl_name, sizeof(bl_name), "appledisplay%d", | 282 | snprintf(bl_name, sizeof(bl_name), "appledisplay%d", |
281 | atomic_inc_return(&count_displays) - 1); | 283 | atomic_inc_return(&count_displays) - 1); |
284 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
285 | props.max_brightness = 0xff; | ||
282 | pdata->bd = backlight_device_register(bl_name, NULL, pdata, | 286 | pdata->bd = backlight_device_register(bl_name, NULL, pdata, |
283 | &appledisplay_bl_data); | 287 | &appledisplay_bl_data, &props); |
284 | if (IS_ERR(pdata->bd)) { | 288 | if (IS_ERR(pdata->bd)) { |
285 | dev_err(&iface->dev, "Backlight registration failed\n"); | 289 | dev_err(&iface->dev, "Backlight registration failed\n"); |
286 | retval = PTR_ERR(pdata->bd); | 290 | retval = PTR_ERR(pdata->bd); |
287 | goto error; | 291 | goto error; |
288 | } | 292 | } |
289 | 293 | ||
290 | pdata->bd->props.max_brightness = 0xff; | ||
291 | |||
292 | /* Try to get brightness */ | 294 | /* Try to get brightness */ |
293 | brightness = appledisplay_bl_get_brightness(pdata->bd); | 295 | brightness = appledisplay_bl_get_brightness(pdata->bd); |
294 | 296 | ||
diff --git a/drivers/usb/misc/cypress_cy7c63.c b/drivers/usb/misc/cypress_cy7c63.c index 1547d8cac5fb..2f43c57743c9 100644 --- a/drivers/usb/misc/cypress_cy7c63.c +++ b/drivers/usb/misc/cypress_cy7c63.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
33 | #include <linux/module.h> | 33 | #include <linux/module.h> |
34 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
35 | #include <linux/slab.h> | ||
35 | #include <linux/usb.h> | 36 | #include <linux/usb.h> |
36 | 37 | ||
37 | #define DRIVER_AUTHOR "Oliver Bock (bock@tfh-berlin.de)" | 38 | #define DRIVER_AUTHOR "Oliver Bock (bock@tfh-berlin.de)" |
diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c index b9cbbbda8245..1d7251bc1b5f 100644 --- a/drivers/usb/misc/cytherm.c +++ b/drivers/usb/misc/cytherm.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/slab.h> | ||
20 | #include <linux/module.h> | 21 | #include <linux/module.h> |
21 | #include <linux/usb.h> | 22 | #include <linux/usb.h> |
22 | 23 | ||
diff --git a/drivers/usb/misc/isight_firmware.c b/drivers/usb/misc/isight_firmware.c index 06e990adc6cd..fe1d44319d0a 100644 --- a/drivers/usb/misc/isight_firmware.c +++ b/drivers/usb/misc/isight_firmware.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/firmware.h> | 25 | #include <linux/firmware.h> |
26 | #include <linux/errno.h> | 26 | #include <linux/errno.h> |
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
28 | #include <linux/slab.h> | ||
28 | 29 | ||
29 | static const struct usb_device_id id_table[] = { | 30 | static const struct usb_device_id id_table[] = { |
30 | {USB_DEVICE(0x05ac, 0x8300)}, | 31 | {USB_DEVICE(0x05ac, 0x8300)}, |
diff --git a/drivers/usb/misc/sisusbvga/sisusb_con.c b/drivers/usb/misc/sisusbvga/sisusb_con.c index b624320df903..b271b0557a1f 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_con.c +++ b/drivers/usb/misc/sisusbvga/sisusb_con.c | |||
@@ -58,7 +58,6 @@ | |||
58 | #include <linux/string.h> | 58 | #include <linux/string.h> |
59 | #include <linux/kd.h> | 59 | #include <linux/kd.h> |
60 | #include <linux/init.h> | 60 | #include <linux/init.h> |
61 | #include <linux/slab.h> | ||
62 | #include <linux/vt_kern.h> | 61 | #include <linux/vt_kern.h> |
63 | #include <linux/selection.h> | 62 | #include <linux/selection.h> |
64 | #include <linux/spinlock.h> | 63 | #include <linux/spinlock.h> |
diff --git a/drivers/usb/misc/sisusbvga/sisusb_init.c b/drivers/usb/misc/sisusbvga/sisusb_init.c index 0ab990744830..cb8a3d91f970 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_init.c +++ b/drivers/usb/misc/sisusbvga/sisusb_init.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <linux/errno.h> | 41 | #include <linux/errno.h> |
42 | #include <linux/poll.h> | 42 | #include <linux/poll.h> |
43 | #include <linux/init.h> | 43 | #include <linux/init.h> |
44 | #include <linux/slab.h> | ||
45 | #include <linux/spinlock.h> | 44 | #include <linux/spinlock.h> |
46 | 45 | ||
47 | #include "sisusb.h" | 46 | #include "sisusb.h" |
diff --git a/drivers/usb/misc/trancevibrator.c b/drivers/usb/misc/trancevibrator.c index 5da28eaee314..d77aba46ae85 100644 --- a/drivers/usb/misc/trancevibrator.c +++ b/drivers/usb/misc/trancevibrator.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/errno.h> | 23 | #include <linux/errno.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/slab.h> | ||
25 | #include <linux/module.h> | 26 | #include <linux/module.h> |
26 | #include <linux/usb.h> | 27 | #include <linux/usb.h> |
27 | 28 | ||
diff --git a/drivers/usb/misc/usbsevseg.c b/drivers/usb/misc/usbsevseg.c index a9555cb901a1..de8ef945b536 100644 --- a/drivers/usb/misc/usbsevseg.c +++ b/drivers/usb/misc/usbsevseg.c | |||
@@ -49,6 +49,7 @@ struct usb_sevsegdev { | |||
49 | u16 textlength; | 49 | u16 textlength; |
50 | 50 | ||
51 | u8 shadow_power; /* for PM */ | 51 | u8 shadow_power; /* for PM */ |
52 | u8 has_interface_pm; | ||
52 | }; | 53 | }; |
53 | 54 | ||
54 | /* sysfs_streq can't replace this completely | 55 | /* sysfs_streq can't replace this completely |
@@ -68,12 +69,16 @@ static void update_display_powered(struct usb_sevsegdev *mydev) | |||
68 | { | 69 | { |
69 | int rc; | 70 | int rc; |
70 | 71 | ||
71 | if (!mydev->shadow_power && mydev->powered) { | 72 | if (mydev->powered && !mydev->has_interface_pm) { |
72 | rc = usb_autopm_get_interface(mydev->intf); | 73 | rc = usb_autopm_get_interface(mydev->intf); |
73 | if (rc < 0) | 74 | if (rc < 0) |
74 | return; | 75 | return; |
76 | mydev->has_interface_pm = 1; | ||
75 | } | 77 | } |
76 | 78 | ||
79 | if (mydev->shadow_power != 1) | ||
80 | return; | ||
81 | |||
77 | rc = usb_control_msg(mydev->udev, | 82 | rc = usb_control_msg(mydev->udev, |
78 | usb_sndctrlpipe(mydev->udev, 0), | 83 | usb_sndctrlpipe(mydev->udev, 0), |
79 | 0x12, | 84 | 0x12, |
@@ -86,8 +91,10 @@ static void update_display_powered(struct usb_sevsegdev *mydev) | |||
86 | if (rc < 0) | 91 | if (rc < 0) |
87 | dev_dbg(&mydev->udev->dev, "power retval = %d\n", rc); | 92 | dev_dbg(&mydev->udev->dev, "power retval = %d\n", rc); |
88 | 93 | ||
89 | if (mydev->shadow_power && !mydev->powered) | 94 | if (!mydev->powered && mydev->has_interface_pm) { |
90 | usb_autopm_put_interface(mydev->intf); | 95 | usb_autopm_put_interface(mydev->intf); |
96 | mydev->has_interface_pm = 0; | ||
97 | } | ||
91 | } | 98 | } |
92 | 99 | ||
93 | static void update_display_mode(struct usb_sevsegdev *mydev) | 100 | static void update_display_mode(struct usb_sevsegdev *mydev) |
@@ -351,6 +358,10 @@ static int sevseg_probe(struct usb_interface *interface, | |||
351 | mydev->intf = interface; | 358 | mydev->intf = interface; |
352 | usb_set_intfdata(interface, mydev); | 359 | usb_set_intfdata(interface, mydev); |
353 | 360 | ||
361 | /* PM */ | ||
362 | mydev->shadow_power = 1; /* currently active */ | ||
363 | mydev->has_interface_pm = 0; /* have not issued autopm_get */ | ||
364 | |||
354 | /*set defaults */ | 365 | /*set defaults */ |
355 | mydev->textmode = 0x02; /* ascii mode */ | 366 | mydev->textmode = 0x02; /* ascii mode */ |
356 | mydev->mode_msb = 0x06; /* 6 characters */ | 367 | mydev->mode_msb = 0x06; /* 6 characters */ |
diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c index f56fed53f2dd..796e2f68f749 100644 --- a/drivers/usb/misc/uss720.c +++ b/drivers/usb/misc/uss720.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <linux/delay.h> | 49 | #include <linux/delay.h> |
50 | #include <linux/completion.h> | 50 | #include <linux/completion.h> |
51 | #include <linux/kref.h> | 51 | #include <linux/kref.h> |
52 | #include <linux/slab.h> | ||
52 | 53 | ||
53 | /* | 54 | /* |
54 | * Version Information | 55 | * Version Information |
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c index 6dd44bc1f5ff..ddf7f9a1b336 100644 --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
18 | #include <linux/smp_lock.h> | 18 | #include <linux/smp_lock.h> |
19 | #include <linux/scatterlist.h> | 19 | #include <linux/scatterlist.h> |
20 | #include <linux/slab.h> | ||
20 | 21 | ||
21 | #include <asm/uaccess.h> | 22 | #include <asm/uaccess.h> |
22 | 23 | ||
diff --git a/drivers/usb/mon/mon_main.c b/drivers/usb/mon/mon_main.c index e0c2db3b767b..e4af18b93c7d 100644 --- a/drivers/usb/mon/mon_main.c +++ b/drivers/usb/mon/mon_main.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/usb.h> | 11 | #include <linux/usb.h> |
12 | #include <linux/slab.h> | ||
12 | #include <linux/notifier.h> | 13 | #include <linux/notifier.h> |
13 | #include <linux/mutex.h> | 14 | #include <linux/mutex.h> |
14 | 15 | ||
diff --git a/drivers/usb/mon/mon_stat.c b/drivers/usb/mon/mon_stat.c index ac8b0d5ce7f8..1becdc3837e6 100644 --- a/drivers/usb/mon/mon_stat.c +++ b/drivers/usb/mon/mon_stat.c | |||
@@ -8,6 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | #include <linux/slab.h> | ||
11 | #include <linux/usb.h> | 12 | #include <linux/usb.h> |
12 | #include <linux/fs.h> | 13 | #include <linux/fs.h> |
13 | #include <asm/uaccess.h> | 14 | #include <asm/uaccess.h> |
diff --git a/drivers/usb/mon/mon_text.c b/drivers/usb/mon/mon_text.c index 31c11888ec6a..4d0be130f49b 100644 --- a/drivers/usb/mon/mon_text.c +++ b/drivers/usb/mon/mon_text.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/kernel.h> | 7 | #include <linux/kernel.h> |
8 | #include <linux/list.h> | 8 | #include <linux/list.h> |
9 | #include <linux/usb.h> | 9 | #include <linux/usb.h> |
10 | #include <linux/slab.h> | ||
10 | #include <linux/time.h> | 11 | #include <linux/time.h> |
11 | #include <linux/mutex.h> | 12 | #include <linux/mutex.h> |
12 | #include <linux/debugfs.h> | 13 | #include <linux/debugfs.h> |
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig index b4c783c284ba..07fe490b44d8 100644 --- a/drivers/usb/musb/Kconfig +++ b/drivers/usb/musb/Kconfig | |||
@@ -42,7 +42,7 @@ config USB_MUSB_SOC | |||
42 | default y if (BF52x && !BF522 && !BF523) | 42 | default y if (BF52x && !BF522 && !BF523) |
43 | 43 | ||
44 | comment "DaVinci 35x and 644x USB support" | 44 | comment "DaVinci 35x and 644x USB support" |
45 | depends on USB_MUSB_HDRC && ARCH_DAVINCI | 45 | depends on USB_MUSB_HDRC && ARCH_DAVINCI_DMx |
46 | 46 | ||
47 | comment "OMAP 243x high speed USB support" | 47 | comment "OMAP 243x high speed USB support" |
48 | depends on USB_MUSB_HDRC && ARCH_OMAP2430 | 48 | depends on USB_MUSB_HDRC && ARCH_OMAP2430 |
diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile index 85710ccc1887..3a485dabebbb 100644 --- a/drivers/usb/musb/Makefile +++ b/drivers/usb/musb/Makefile | |||
@@ -6,7 +6,7 @@ musb_hdrc-objs := musb_core.o | |||
6 | 6 | ||
7 | obj-$(CONFIG_USB_MUSB_HDRC) += musb_hdrc.o | 7 | obj-$(CONFIG_USB_MUSB_HDRC) += musb_hdrc.o |
8 | 8 | ||
9 | ifeq ($(CONFIG_ARCH_DAVINCI),y) | 9 | ifeq ($(CONFIG_ARCH_DAVINCI_DMx),y) |
10 | musb_hdrc-objs += davinci.o | 10 | musb_hdrc-objs += davinci.o |
11 | endif | 11 | endif |
12 | 12 | ||
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index bcee1339d4fd..ec8d324237f6 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
14 | #include <linux/slab.h> | ||
15 | #include <linux/init.h> | 14 | #include <linux/init.h> |
16 | #include <linux/list.h> | 15 | #include <linux/list.h> |
17 | #include <linux/gpio.h> | 16 | #include <linux/gpio.h> |
@@ -173,13 +172,7 @@ static irqreturn_t blackfin_interrupt(int irq, void *__hci) | |||
173 | 172 | ||
174 | spin_unlock_irqrestore(&musb->lock, flags); | 173 | spin_unlock_irqrestore(&musb->lock, flags); |
175 | 174 | ||
176 | /* REVISIT we sometimes get spurious IRQs on g_ep0 | 175 | return retval; |
177 | * not clear why... fall in BF54x too. | ||
178 | */ | ||
179 | if (retval != IRQ_HANDLED) | ||
180 | DBG(5, "spurious?\n"); | ||
181 | |||
182 | return IRQ_HANDLED; | ||
183 | } | 176 | } |
184 | 177 | ||
185 | static void musb_conn_timer_handler(unsigned long _musb) | 178 | static void musb_conn_timer_handler(unsigned long _musb) |
diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c index 3c69a76ec392..59dc3d351b60 100644 --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c | |||
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/platform_device.h> | 9 | #include <linux/platform_device.h> |
10 | #include <linux/slab.h> | ||
10 | #include <linux/usb.h> | 11 | #include <linux/usb.h> |
11 | 12 | ||
12 | #include "musb_core.h" | 13 | #include "musb_core.h" |
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 66913811af5e..ce2e16fee0df 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
26 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
27 | #include <linux/slab.h> | ||
28 | #include <linux/init.h> | 27 | #include <linux/init.h> |
29 | #include <linux/list.h> | 28 | #include <linux/list.h> |
30 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
@@ -274,7 +273,7 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci) | |||
274 | /* NOTE: DaVinci shadows the Mentor IRQs. Don't manage them through | 273 | /* NOTE: DaVinci shadows the Mentor IRQs. Don't manage them through |
275 | * the Mentor registers (except for setup), use the TI ones and EOI. | 274 | * the Mentor registers (except for setup), use the TI ones and EOI. |
276 | * | 275 | * |
277 | * Docs describe irq "vector" registers asociated with the CPPI and | 276 | * Docs describe irq "vector" registers associated with the CPPI and |
278 | * USB EOI registers. These hold a bitmask corresponding to the | 277 | * USB EOI registers. These hold a bitmask corresponding to the |
279 | * current IRQ, not an irq handler address. Would using those bits | 278 | * current IRQ, not an irq handler address. Would using those bits |
280 | * resolve some of the races observed in this dispatch code?? | 279 | * resolve some of the races observed in this dispatch code?? |
@@ -445,6 +444,8 @@ int __init musb_platform_init(struct musb *musb) | |||
445 | return 0; | 444 | return 0; |
446 | 445 | ||
447 | fail: | 446 | fail: |
447 | clk_disable(musb->clock); | ||
448 | |||
448 | usb_nop_xceiv_unregister(); | 449 | usb_nop_xceiv_unregister(); |
449 | return -ENODEV; | 450 | return -ENODEV; |
450 | } | 451 | } |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index b4bbf8f2c238..705cc4ad8737 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -379,7 +379,6 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, | |||
379 | u8 devctl, u8 power) | 379 | u8 devctl, u8 power) |
380 | { | 380 | { |
381 | irqreturn_t handled = IRQ_NONE; | 381 | irqreturn_t handled = IRQ_NONE; |
382 | void __iomem *mbase = musb->mregs; | ||
383 | 382 | ||
384 | DBG(3, "<== Power=%02x, DevCtl=%02x, int_usb=0x%x\n", power, devctl, | 383 | DBG(3, "<== Power=%02x, DevCtl=%02x, int_usb=0x%x\n", power, devctl, |
385 | int_usb); | 384 | int_usb); |
@@ -394,6 +393,8 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, | |||
394 | 393 | ||
395 | if (devctl & MUSB_DEVCTL_HM) { | 394 | if (devctl & MUSB_DEVCTL_HM) { |
396 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | 395 | #ifdef CONFIG_USB_MUSB_HDRC_HCD |
396 | void __iomem *mbase = musb->mregs; | ||
397 | |||
397 | switch (musb->xceiv->state) { | 398 | switch (musb->xceiv->state) { |
398 | case OTG_STATE_A_SUSPEND: | 399 | case OTG_STATE_A_SUSPEND: |
399 | /* remote wakeup? later, GetPortStatus | 400 | /* remote wakeup? later, GetPortStatus |
@@ -471,6 +472,8 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, | |||
471 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | 472 | #ifdef CONFIG_USB_MUSB_HDRC_HCD |
472 | /* see manual for the order of the tests */ | 473 | /* see manual for the order of the tests */ |
473 | if (int_usb & MUSB_INTR_SESSREQ) { | 474 | if (int_usb & MUSB_INTR_SESSREQ) { |
475 | void __iomem *mbase = musb->mregs; | ||
476 | |||
474 | DBG(1, "SESSION_REQUEST (%s)\n", otg_state_string(musb)); | 477 | DBG(1, "SESSION_REQUEST (%s)\n", otg_state_string(musb)); |
475 | 478 | ||
476 | /* IRQ arrives from ID pin sense or (later, if VBUS power | 479 | /* IRQ arrives from ID pin sense or (later, if VBUS power |
@@ -519,6 +522,8 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, | |||
519 | case OTG_STATE_A_WAIT_BCON: | 522 | case OTG_STATE_A_WAIT_BCON: |
520 | case OTG_STATE_A_WAIT_VRISE: | 523 | case OTG_STATE_A_WAIT_VRISE: |
521 | if (musb->vbuserr_retry) { | 524 | if (musb->vbuserr_retry) { |
525 | void __iomem *mbase = musb->mregs; | ||
526 | |||
522 | musb->vbuserr_retry--; | 527 | musb->vbuserr_retry--; |
523 | ignore = 1; | 528 | ignore = 1; |
524 | devctl |= MUSB_DEVCTL_SESSION; | 529 | devctl |= MUSB_DEVCTL_SESSION; |
@@ -622,6 +627,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, | |||
622 | 627 | ||
623 | if (int_usb & MUSB_INTR_CONNECT) { | 628 | if (int_usb & MUSB_INTR_CONNECT) { |
624 | struct usb_hcd *hcd = musb_to_hcd(musb); | 629 | struct usb_hcd *hcd = musb_to_hcd(musb); |
630 | void __iomem *mbase = musb->mregs; | ||
625 | 631 | ||
626 | handled = IRQ_HANDLED; | 632 | handled = IRQ_HANDLED; |
627 | musb->is_active = 1; | 633 | musb->is_active = 1; |
@@ -959,10 +965,8 @@ static void musb_shutdown(struct platform_device *pdev) | |||
959 | spin_lock_irqsave(&musb->lock, flags); | 965 | spin_lock_irqsave(&musb->lock, flags); |
960 | musb_platform_disable(musb); | 966 | musb_platform_disable(musb); |
961 | musb_generic_disable(musb); | 967 | musb_generic_disable(musb); |
962 | if (musb->clock) { | 968 | if (musb->clock) |
963 | clk_put(musb->clock); | 969 | clk_put(musb->clock); |
964 | musb->clock = NULL; | ||
965 | } | ||
966 | spin_unlock_irqrestore(&musb->lock, flags); | 970 | spin_unlock_irqrestore(&musb->lock, flags); |
967 | 971 | ||
968 | /* FIXME power down */ | 972 | /* FIXME power down */ |
@@ -1847,15 +1851,6 @@ static void musb_free(struct musb *musb) | |||
1847 | put_device(musb->xceiv->dev); | 1851 | put_device(musb->xceiv->dev); |
1848 | #endif | 1852 | #endif |
1849 | 1853 | ||
1850 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); | ||
1851 | musb_platform_exit(musb); | ||
1852 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); | ||
1853 | |||
1854 | if (musb->clock) { | ||
1855 | clk_disable(musb->clock); | ||
1856 | clk_put(musb->clock); | ||
1857 | } | ||
1858 | |||
1859 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | 1854 | #ifdef CONFIG_USB_MUSB_HDRC_HCD |
1860 | usb_put_hcd(musb_to_hcd(musb)); | 1855 | usb_put_hcd(musb_to_hcd(musb)); |
1861 | #else | 1856 | #else |
@@ -1883,8 +1878,10 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) | |||
1883 | */ | 1878 | */ |
1884 | if (!plat) { | 1879 | if (!plat) { |
1885 | dev_dbg(dev, "no platform_data?\n"); | 1880 | dev_dbg(dev, "no platform_data?\n"); |
1886 | return -ENODEV; | 1881 | status = -ENODEV; |
1882 | goto fail0; | ||
1887 | } | 1883 | } |
1884 | |||
1888 | switch (plat->mode) { | 1885 | switch (plat->mode) { |
1889 | case MUSB_HOST: | 1886 | case MUSB_HOST: |
1890 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | 1887 | #ifdef CONFIG_USB_MUSB_HDRC_HCD |
@@ -1906,13 +1903,16 @@ bad_config: | |||
1906 | #endif | 1903 | #endif |
1907 | default: | 1904 | default: |
1908 | dev_err(dev, "incompatible Kconfig role setting\n"); | 1905 | dev_err(dev, "incompatible Kconfig role setting\n"); |
1909 | return -EINVAL; | 1906 | status = -EINVAL; |
1907 | goto fail0; | ||
1910 | } | 1908 | } |
1911 | 1909 | ||
1912 | /* allocate */ | 1910 | /* allocate */ |
1913 | musb = allocate_instance(dev, plat->config, ctrl); | 1911 | musb = allocate_instance(dev, plat->config, ctrl); |
1914 | if (!musb) | 1912 | if (!musb) { |
1915 | return -ENOMEM; | 1913 | status = -ENOMEM; |
1914 | goto fail0; | ||
1915 | } | ||
1916 | 1916 | ||
1917 | spin_lock_init(&musb->lock); | 1917 | spin_lock_init(&musb->lock); |
1918 | musb->board_mode = plat->mode; | 1918 | musb->board_mode = plat->mode; |
@@ -1930,7 +1930,7 @@ bad_config: | |||
1930 | if (IS_ERR(musb->clock)) { | 1930 | if (IS_ERR(musb->clock)) { |
1931 | status = PTR_ERR(musb->clock); | 1931 | status = PTR_ERR(musb->clock); |
1932 | musb->clock = NULL; | 1932 | musb->clock = NULL; |
1933 | goto fail; | 1933 | goto fail1; |
1934 | } | 1934 | } |
1935 | } | 1935 | } |
1936 | 1936 | ||
@@ -1949,12 +1949,12 @@ bad_config: | |||
1949 | */ | 1949 | */ |
1950 | musb->isr = generic_interrupt; | 1950 | musb->isr = generic_interrupt; |
1951 | status = musb_platform_init(musb); | 1951 | status = musb_platform_init(musb); |
1952 | |||
1953 | if (status < 0) | 1952 | if (status < 0) |
1954 | goto fail; | 1953 | goto fail2; |
1954 | |||
1955 | if (!musb->isr) { | 1955 | if (!musb->isr) { |
1956 | status = -ENODEV; | 1956 | status = -ENODEV; |
1957 | goto fail2; | 1957 | goto fail3; |
1958 | } | 1958 | } |
1959 | 1959 | ||
1960 | #ifndef CONFIG_MUSB_PIO_ONLY | 1960 | #ifndef CONFIG_MUSB_PIO_ONLY |
@@ -1980,7 +1980,7 @@ bad_config: | |||
1980 | ? MUSB_CONTROLLER_MHDRC | 1980 | ? MUSB_CONTROLLER_MHDRC |
1981 | : MUSB_CONTROLLER_HDRC, musb); | 1981 | : MUSB_CONTROLLER_HDRC, musb); |
1982 | if (status < 0) | 1982 | if (status < 0) |
1983 | goto fail2; | 1983 | goto fail3; |
1984 | 1984 | ||
1985 | #ifdef CONFIG_USB_MUSB_OTG | 1985 | #ifdef CONFIG_USB_MUSB_OTG |
1986 | setup_timer(&musb->otg_timer, musb_otg_timer_func, (unsigned long) musb); | 1986 | setup_timer(&musb->otg_timer, musb_otg_timer_func, (unsigned long) musb); |
@@ -1993,7 +1993,7 @@ bad_config: | |||
1993 | if (request_irq(nIrq, musb->isr, 0, dev_name(dev), musb)) { | 1993 | if (request_irq(nIrq, musb->isr, 0, dev_name(dev), musb)) { |
1994 | dev_err(dev, "request_irq %d failed!\n", nIrq); | 1994 | dev_err(dev, "request_irq %d failed!\n", nIrq); |
1995 | status = -ENODEV; | 1995 | status = -ENODEV; |
1996 | goto fail2; | 1996 | goto fail3; |
1997 | } | 1997 | } |
1998 | musb->nIrq = nIrq; | 1998 | musb->nIrq = nIrq; |
1999 | /* FIXME this handles wakeup irqs wrong */ | 1999 | /* FIXME this handles wakeup irqs wrong */ |
@@ -2007,7 +2007,6 @@ bad_config: | |||
2007 | /* host side needs more setup */ | 2007 | /* host side needs more setup */ |
2008 | if (is_host_enabled(musb)) { | 2008 | if (is_host_enabled(musb)) { |
2009 | struct usb_hcd *hcd = musb_to_hcd(musb); | 2009 | struct usb_hcd *hcd = musb_to_hcd(musb); |
2010 | u8 busctl; | ||
2011 | 2010 | ||
2012 | otg_set_host(musb->xceiv, &hcd->self); | 2011 | otg_set_host(musb->xceiv, &hcd->self); |
2013 | 2012 | ||
@@ -2018,9 +2017,9 @@ bad_config: | |||
2018 | 2017 | ||
2019 | /* program PHY to use external vBus if required */ | 2018 | /* program PHY to use external vBus if required */ |
2020 | if (plat->extvbus) { | 2019 | if (plat->extvbus) { |
2021 | busctl = musb_readb(musb->mregs, MUSB_ULPI_BUSCONTROL); | 2020 | u8 busctl = musb_read_ulpi_buscontrol(musb->mregs); |
2022 | busctl |= MUSB_ULPI_USE_EXTVBUS; | 2021 | busctl |= MUSB_ULPI_USE_EXTVBUS; |
2023 | musb_writeb(musb->mregs, MUSB_ULPI_BUSCONTROL, busctl); | 2022 | musb_write_ulpi_buscontrol(musb->mregs, busctl); |
2024 | } | 2023 | } |
2025 | } | 2024 | } |
2026 | 2025 | ||
@@ -2034,8 +2033,6 @@ bad_config: | |||
2034 | musb->xceiv->state = OTG_STATE_A_IDLE; | 2033 | musb->xceiv->state = OTG_STATE_A_IDLE; |
2035 | 2034 | ||
2036 | status = usb_add_hcd(musb_to_hcd(musb), -1, 0); | 2035 | status = usb_add_hcd(musb_to_hcd(musb), -1, 0); |
2037 | if (status) | ||
2038 | goto fail; | ||
2039 | 2036 | ||
2040 | DBG(1, "%s mode, status %d, devctl %02x %c\n", | 2037 | DBG(1, "%s mode, status %d, devctl %02x %c\n", |
2041 | "HOST", status, | 2038 | "HOST", status, |
@@ -2050,8 +2047,6 @@ bad_config: | |||
2050 | musb->xceiv->state = OTG_STATE_B_IDLE; | 2047 | musb->xceiv->state = OTG_STATE_B_IDLE; |
2051 | 2048 | ||
2052 | status = musb_gadget_setup(musb); | 2049 | status = musb_gadget_setup(musb); |
2053 | if (status) | ||
2054 | goto fail; | ||
2055 | 2050 | ||
2056 | DBG(1, "%s mode, status %d, dev%02x\n", | 2051 | DBG(1, "%s mode, status %d, dev%02x\n", |
2057 | is_otg_enabled(musb) ? "OTG" : "PERIPHERAL", | 2052 | is_otg_enabled(musb) ? "OTG" : "PERIPHERAL", |
@@ -2059,12 +2054,14 @@ bad_config: | |||
2059 | musb_readb(musb->mregs, MUSB_DEVCTL)); | 2054 | musb_readb(musb->mregs, MUSB_DEVCTL)); |
2060 | 2055 | ||
2061 | } | 2056 | } |
2057 | if (status < 0) | ||
2058 | goto fail3; | ||
2062 | 2059 | ||
2063 | #ifdef CONFIG_SYSFS | 2060 | #ifdef CONFIG_SYSFS |
2064 | status = sysfs_create_group(&musb->controller->kobj, &musb_attr_group); | 2061 | status = sysfs_create_group(&musb->controller->kobj, &musb_attr_group); |
2065 | #endif | ||
2066 | if (status) | 2062 | if (status) |
2067 | goto fail2; | 2063 | goto fail4; |
2064 | #endif | ||
2068 | 2065 | ||
2069 | dev_info(dev, "USB %s mode controller at %p using %s, IRQ %d\n", | 2066 | dev_info(dev, "USB %s mode controller at %p using %s, IRQ %d\n", |
2070 | ({char *s; | 2067 | ({char *s; |
@@ -2080,17 +2077,29 @@ bad_config: | |||
2080 | 2077 | ||
2081 | return 0; | 2078 | return 0; |
2082 | 2079 | ||
2083 | fail2: | 2080 | fail4: |
2081 | if (!is_otg_enabled(musb) && is_host_enabled(musb)) | ||
2082 | usb_remove_hcd(musb_to_hcd(musb)); | ||
2083 | else | ||
2084 | musb_gadget_cleanup(musb); | ||
2085 | |||
2086 | fail3: | ||
2087 | if (musb->irq_wake) | ||
2088 | device_init_wakeup(dev, 0); | ||
2084 | musb_platform_exit(musb); | 2089 | musb_platform_exit(musb); |
2085 | fail: | ||
2086 | dev_err(musb->controller, | ||
2087 | "musb_init_controller failed with status %d\n", status); | ||
2088 | 2090 | ||
2091 | fail2: | ||
2089 | if (musb->clock) | 2092 | if (musb->clock) |
2090 | clk_put(musb->clock); | 2093 | clk_put(musb->clock); |
2091 | device_init_wakeup(dev, 0); | 2094 | |
2095 | fail1: | ||
2096 | dev_err(musb->controller, | ||
2097 | "musb_init_controller failed with status %d\n", status); | ||
2098 | |||
2092 | musb_free(musb); | 2099 | musb_free(musb); |
2093 | 2100 | ||
2101 | fail0: | ||
2102 | |||
2094 | return status; | 2103 | return status; |
2095 | 2104 | ||
2096 | } | 2105 | } |
@@ -2127,7 +2136,6 @@ static int __init musb_probe(struct platform_device *pdev) | |||
2127 | /* clobbered by use_dma=n */ | 2136 | /* clobbered by use_dma=n */ |
2128 | orig_dma_mask = dev->dma_mask; | 2137 | orig_dma_mask = dev->dma_mask; |
2129 | #endif | 2138 | #endif |
2130 | |||
2131 | status = musb_init_controller(dev, irq, base); | 2139 | status = musb_init_controller(dev, irq, base); |
2132 | if (status < 0) | 2140 | if (status < 0) |
2133 | iounmap(base); | 2141 | iounmap(base); |
@@ -2150,6 +2158,10 @@ static int __exit musb_remove(struct platform_device *pdev) | |||
2150 | if (musb->board_mode == MUSB_HOST) | 2158 | if (musb->board_mode == MUSB_HOST) |
2151 | usb_remove_hcd(musb_to_hcd(musb)); | 2159 | usb_remove_hcd(musb_to_hcd(musb)); |
2152 | #endif | 2160 | #endif |
2161 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); | ||
2162 | musb_platform_exit(musb); | ||
2163 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); | ||
2164 | |||
2153 | musb_free(musb); | 2165 | musb_free(musb); |
2154 | iounmap(ctrl_base); | 2166 | iounmap(ctrl_base); |
2155 | device_init_wakeup(&pdev->dev, 0); | 2167 | device_init_wakeup(&pdev->dev, 0); |
@@ -2171,6 +2183,7 @@ void musb_save_context(struct musb *musb) | |||
2171 | if (is_host_enabled(musb)) { | 2183 | if (is_host_enabled(musb)) { |
2172 | musb_context.frame = musb_readw(musb_base, MUSB_FRAME); | 2184 | musb_context.frame = musb_readw(musb_base, MUSB_FRAME); |
2173 | musb_context.testmode = musb_readb(musb_base, MUSB_TESTMODE); | 2185 | musb_context.testmode = musb_readb(musb_base, MUSB_TESTMODE); |
2186 | musb_context.busctl = musb_read_ulpi_buscontrol(musb->mregs); | ||
2174 | } | 2187 | } |
2175 | musb_context.power = musb_readb(musb_base, MUSB_POWER); | 2188 | musb_context.power = musb_readb(musb_base, MUSB_POWER); |
2176 | musb_context.intrtxe = musb_readw(musb_base, MUSB_INTRTXE); | 2189 | musb_context.intrtxe = musb_readw(musb_base, MUSB_INTRTXE); |
@@ -2242,6 +2255,7 @@ void musb_restore_context(struct musb *musb) | |||
2242 | if (is_host_enabled(musb)) { | 2255 | if (is_host_enabled(musb)) { |
2243 | musb_writew(musb_base, MUSB_FRAME, musb_context.frame); | 2256 | musb_writew(musb_base, MUSB_FRAME, musb_context.frame); |
2244 | musb_writeb(musb_base, MUSB_TESTMODE, musb_context.testmode); | 2257 | musb_writeb(musb_base, MUSB_TESTMODE, musb_context.testmode); |
2258 | musb_write_ulpi_buscontrol(musb->mregs, musb_context.busctl); | ||
2245 | } | 2259 | } |
2246 | musb_writeb(musb_base, MUSB_POWER, musb_context.power); | 2260 | musb_writeb(musb_base, MUSB_POWER, musb_context.power); |
2247 | musb_writew(musb_base, MUSB_INTRTXE, musb_context.intrtxe); | 2261 | musb_writew(musb_base, MUSB_INTRTXE, musb_context.intrtxe); |
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index d849fb81c131..ac17b004909b 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h | |||
@@ -469,7 +469,7 @@ struct musb_csr_regs { | |||
469 | 469 | ||
470 | struct musb_context_registers { | 470 | struct musb_context_registers { |
471 | 471 | ||
472 | #if defined(CONFIG_ARCH_OMAP34XX) || defined(CONFIG_ARCH_OMAP2430) | 472 | #ifdef CONFIG_PM |
473 | u32 otg_sysconfig, otg_forcestandby; | 473 | u32 otg_sysconfig, otg_forcestandby; |
474 | #endif | 474 | #endif |
475 | u8 power; | 475 | u8 power; |
@@ -478,12 +478,12 @@ struct musb_context_registers { | |||
478 | u16 frame; | 478 | u16 frame; |
479 | u8 index, testmode; | 479 | u8 index, testmode; |
480 | 480 | ||
481 | u8 devctl, misc; | 481 | u8 devctl, busctl, misc; |
482 | 482 | ||
483 | struct musb_csr_regs index_regs[MUSB_C_NUM_EPS]; | 483 | struct musb_csr_regs index_regs[MUSB_C_NUM_EPS]; |
484 | }; | 484 | }; |
485 | 485 | ||
486 | #if defined(CONFIG_ARCH_OMAP34XX) || defined(CONFIG_ARCH_OMAP2430) | 486 | #ifdef CONFIG_PM |
487 | extern void musb_platform_save_context(struct musb *musb, | 487 | extern void musb_platform_save_context(struct musb *musb, |
488 | struct musb_context_registers *musb_context); | 488 | struct musb_context_registers *musb_context); |
489 | extern void musb_platform_restore_context(struct musb *musb, | 489 | extern void musb_platform_restore_context(struct musb *musb, |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index a9f288cd70ed..6fca870e957e 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <linux/moduleparam.h> | 43 | #include <linux/moduleparam.h> |
44 | #include <linux/stat.h> | 44 | #include <linux/stat.h> |
45 | #include <linux/dma-mapping.h> | 45 | #include <linux/dma-mapping.h> |
46 | #include <linux/slab.h> | ||
46 | 47 | ||
47 | #include "musb_core.h" | 48 | #include "musb_core.h" |
48 | 49 | ||
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 3421cf9858b5..877d20b1dff9 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -1689,7 +1689,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1689 | dma->desired_mode = 1; | 1689 | dma->desired_mode = 1; |
1690 | if (rx_count < hw_ep->max_packet_sz_rx) { | 1690 | if (rx_count < hw_ep->max_packet_sz_rx) { |
1691 | length = rx_count; | 1691 | length = rx_count; |
1692 | dma->bDesiredMode = 0; | 1692 | dma->desired_mode = 0; |
1693 | } else { | 1693 | } else { |
1694 | length = urb->transfer_buffer_length; | 1694 | length = urb->transfer_buffer_length; |
1695 | } | 1695 | } |
@@ -2042,6 +2042,7 @@ static int musb_urb_enqueue( | |||
2042 | * odd, rare, error prone, but legal. | 2042 | * odd, rare, error prone, but legal. |
2043 | */ | 2043 | */ |
2044 | kfree(qh); | 2044 | kfree(qh); |
2045 | qh = NULL; | ||
2045 | ret = 0; | 2046 | ret = 0; |
2046 | } else | 2047 | } else |
2047 | ret = musb_schedule(musb, qh, | 2048 | ret = musb_schedule(musb, qh, |
diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h index 292894a2c247..fa55aacc385d 100644 --- a/drivers/usb/musb/musb_regs.h +++ b/drivers/usb/musb/musb_regs.h | |||
@@ -326,6 +326,11 @@ static inline void musb_write_rxfifoadd(void __iomem *mbase, u16 c_off) | |||
326 | musb_writew(mbase, MUSB_RXFIFOADD, c_off); | 326 | musb_writew(mbase, MUSB_RXFIFOADD, c_off); |
327 | } | 327 | } |
328 | 328 | ||
329 | static inline void musb_write_ulpi_buscontrol(void __iomem *mbase, u8 val) | ||
330 | { | ||
331 | musb_writeb(mbase, MUSB_ULPI_BUSCONTROL, val); | ||
332 | } | ||
333 | |||
329 | static inline u8 musb_read_txfifosz(void __iomem *mbase) | 334 | static inline u8 musb_read_txfifosz(void __iomem *mbase) |
330 | { | 335 | { |
331 | return musb_readb(mbase, MUSB_TXFIFOSZ); | 336 | return musb_readb(mbase, MUSB_TXFIFOSZ); |
@@ -346,6 +351,11 @@ static inline u16 musb_read_rxfifoadd(void __iomem *mbase) | |||
346 | return musb_readw(mbase, MUSB_RXFIFOADD); | 351 | return musb_readw(mbase, MUSB_RXFIFOADD); |
347 | } | 352 | } |
348 | 353 | ||
354 | static inline u8 musb_read_ulpi_buscontrol(void __iomem *mbase) | ||
355 | { | ||
356 | return musb_readb(mbase, MUSB_ULPI_BUSCONTROL); | ||
357 | } | ||
358 | |||
349 | static inline u8 musb_read_configdata(void __iomem *mbase) | 359 | static inline u8 musb_read_configdata(void __iomem *mbase) |
350 | { | 360 | { |
351 | musb_writeb(mbase, MUSB_INDEX, 0); | 361 | musb_writeb(mbase, MUSB_INDEX, 0); |
@@ -491,7 +501,7 @@ static inline u8 musb_read_txhubport(void __iomem *mbase, u8 epnum) | |||
491 | #define MUSB_FLAT_OFFSET(_epnum, _offset) \ | 501 | #define MUSB_FLAT_OFFSET(_epnum, _offset) \ |
492 | (USB_OFFSET(USB_EP_NI0_TXMAXP) + (0x40 * (_epnum)) + (_offset)) | 502 | (USB_OFFSET(USB_EP_NI0_TXMAXP) + (0x40 * (_epnum)) + (_offset)) |
493 | 503 | ||
494 | /* Not implemented - HW has seperate Tx/Rx FIFO */ | 504 | /* Not implemented - HW has separate Tx/Rx FIFO */ |
495 | #define MUSB_TXCSR_MODE 0x0000 | 505 | #define MUSB_TXCSR_MODE 0x0000 |
496 | 506 | ||
497 | static inline void musb_write_txfifosz(void __iomem *mbase, u8 c_size) | 507 | static inline void musb_write_txfifosz(void __iomem *mbase, u8 c_size) |
@@ -510,20 +520,33 @@ static inline void musb_write_rxfifoadd(void __iomem *mbase, u16 c_off) | |||
510 | { | 520 | { |
511 | } | 521 | } |
512 | 522 | ||
523 | static inline void musb_write_ulpi_buscontrol(void __iomem *mbase, u8 val) | ||
524 | { | ||
525 | } | ||
526 | |||
513 | static inline u8 musb_read_txfifosz(void __iomem *mbase) | 527 | static inline u8 musb_read_txfifosz(void __iomem *mbase) |
514 | { | 528 | { |
529 | return 0; | ||
515 | } | 530 | } |
516 | 531 | ||
517 | static inline u16 musb_read_txfifoadd(void __iomem *mbase) | 532 | static inline u16 musb_read_txfifoadd(void __iomem *mbase) |
518 | { | 533 | { |
534 | return 0; | ||
519 | } | 535 | } |
520 | 536 | ||
521 | static inline u8 musb_read_rxfifosz(void __iomem *mbase) | 537 | static inline u8 musb_read_rxfifosz(void __iomem *mbase) |
522 | { | 538 | { |
539 | return 0; | ||
523 | } | 540 | } |
524 | 541 | ||
525 | static inline u16 musb_read_rxfifoadd(void __iomem *mbase) | 542 | static inline u16 musb_read_rxfifoadd(void __iomem *mbase) |
526 | { | 543 | { |
544 | return 0; | ||
545 | } | ||
546 | |||
547 | static inline u8 musb_read_ulpi_buscontrol(void __iomem *mbase) | ||
548 | { | ||
549 | return 0; | ||
527 | } | 550 | } |
528 | 551 | ||
529 | static inline u8 musb_read_configdata(void __iomem *mbase) | 552 | static inline u8 musb_read_configdata(void __iomem *mbase) |
@@ -577,22 +600,27 @@ static inline void musb_write_txhubport(void __iomem *mbase, u8 epnum, | |||
577 | 600 | ||
578 | static inline u8 musb_read_rxfunaddr(void __iomem *mbase, u8 epnum) | 601 | static inline u8 musb_read_rxfunaddr(void __iomem *mbase, u8 epnum) |
579 | { | 602 | { |
603 | return 0; | ||
580 | } | 604 | } |
581 | 605 | ||
582 | static inline u8 musb_read_rxhubaddr(void __iomem *mbase, u8 epnum) | 606 | static inline u8 musb_read_rxhubaddr(void __iomem *mbase, u8 epnum) |
583 | { | 607 | { |
608 | return 0; | ||
584 | } | 609 | } |
585 | 610 | ||
586 | static inline u8 musb_read_rxhubport(void __iomem *mbase, u8 epnum) | 611 | static inline u8 musb_read_rxhubport(void __iomem *mbase, u8 epnum) |
587 | { | 612 | { |
613 | return 0; | ||
588 | } | 614 | } |
589 | 615 | ||
590 | static inline u8 musb_read_txfunaddr(void __iomem *mbase, u8 epnum) | 616 | static inline u8 musb_read_txfunaddr(void __iomem *mbase, u8 epnum) |
591 | { | 617 | { |
618 | return 0; | ||
592 | } | 619 | } |
593 | 620 | ||
594 | static inline u8 musb_read_txhubaddr(void __iomem *mbase, u8 epnum) | 621 | static inline u8 musb_read_txhubaddr(void __iomem *mbase, u8 epnum) |
595 | { | 622 | { |
623 | return 0; | ||
596 | } | 624 | } |
597 | 625 | ||
598 | static inline void musb_read_txhubport(void __iomem *mbase, u8 epnum) | 626 | static inline void musb_read_txhubport(void __iomem *mbase, u8 epnum) |
diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c index bfe5fe4ebfee..7775e1c0a215 100644 --- a/drivers/usb/musb/musb_virthub.c +++ b/drivers/usb/musb/musb_virthub.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
36 | #include <linux/kernel.h> | 36 | #include <linux/kernel.h> |
37 | #include <linux/sched.h> | 37 | #include <linux/sched.h> |
38 | #include <linux/slab.h> | ||
39 | #include <linux/errno.h> | 38 | #include <linux/errno.h> |
40 | #include <linux/init.h> | 39 | #include <linux/init.h> |
41 | #include <linux/time.h> | 40 | #include <linux/time.h> |
diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c index 2fa7d5c00f31..1008044a3bbc 100644 --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/device.h> | 33 | #include <linux/device.h> |
34 | #include <linux/interrupt.h> | 34 | #include <linux/interrupt.h> |
35 | #include <linux/platform_device.h> | 35 | #include <linux/platform_device.h> |
36 | #include <linux/slab.h> | ||
36 | #include "musb_core.h" | 37 | #include "musb_core.h" |
37 | #include "musbhsdma.h" | 38 | #include "musbhsdma.h" |
38 | 39 | ||
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 3fe16867b5a8..82592633502f 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
29 | #include <linux/sched.h> | 29 | #include <linux/sched.h> |
30 | #include <linux/slab.h> | ||
31 | #include <linux/init.h> | 30 | #include <linux/init.h> |
32 | #include <linux/list.h> | 31 | #include <linux/list.h> |
33 | #include <linux/clk.h> | 32 | #include <linux/clk.h> |
@@ -332,8 +331,5 @@ int musb_platform_exit(struct musb *musb) | |||
332 | 331 | ||
333 | musb_platform_suspend(musb); | 332 | musb_platform_suspend(musb); |
334 | 333 | ||
335 | clk_put(musb->clock); | ||
336 | musb->clock = NULL; | ||
337 | |||
338 | return 0; | 334 | return 0; |
339 | } | 335 | } |
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index ab776a8d98ca..60d3938cafcf 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
@@ -29,6 +29,19 @@ static void tusb_source_power(struct musb *musb, int is_on); | |||
29 | #define TUSB_REV_MAJOR(reg_val) ((reg_val >> 4) & 0xf) | 29 | #define TUSB_REV_MAJOR(reg_val) ((reg_val >> 4) & 0xf) |
30 | #define TUSB_REV_MINOR(reg_val) (reg_val & 0xf) | 30 | #define TUSB_REV_MINOR(reg_val) (reg_val & 0xf) |
31 | 31 | ||
32 | #ifdef CONFIG_PM | ||
33 | /* REVISIT: These should be only needed if somebody implements off idle */ | ||
34 | void musb_platform_save_context(struct musb *musb, | ||
35 | struct musb_context_registers *musb_context) | ||
36 | { | ||
37 | } | ||
38 | |||
39 | void musb_platform_restore_context(struct musb *musb, | ||
40 | struct musb_context_registers *musb_context) | ||
41 | { | ||
42 | } | ||
43 | #endif | ||
44 | |||
32 | /* | 45 | /* |
33 | * Checks the revision. We need to use the DMA register as 3.0 does not | 46 | * Checks the revision. We need to use the DMA register as 3.0 does not |
34 | * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV. | 47 | * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV. |
diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c index 1c868096bd6f..c061a88f2b0f 100644 --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/usb.h> | 15 | #include <linux/usb.h> |
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/dma-mapping.h> | 17 | #include <linux/dma-mapping.h> |
18 | #include <linux/slab.h> | ||
18 | #include <plat/dma.h> | 19 | #include <plat/dma.h> |
19 | #include <plat/mux.h> | 20 | #include <plat/mux.h> |
20 | 21 | ||
@@ -38,7 +39,7 @@ struct tusb_omap_dma_ch { | |||
38 | 39 | ||
39 | struct tusb_omap_dma *tusb_dma; | 40 | struct tusb_omap_dma *tusb_dma; |
40 | 41 | ||
41 | void __iomem *dma_addr; | 42 | dma_addr_t dma_addr; |
42 | 43 | ||
43 | u32 len; | 44 | u32 len; |
44 | u16 packet_sz; | 45 | u16 packet_sz; |
@@ -125,6 +126,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) | |||
125 | struct tusb_omap_dma_ch *chdat = to_chdat(channel); | 126 | struct tusb_omap_dma_ch *chdat = to_chdat(channel); |
126 | struct tusb_omap_dma *tusb_dma = chdat->tusb_dma; | 127 | struct tusb_omap_dma *tusb_dma = chdat->tusb_dma; |
127 | struct musb *musb = chdat->musb; | 128 | struct musb *musb = chdat->musb; |
129 | struct device *dev = musb->controller; | ||
128 | struct musb_hw_ep *hw_ep = chdat->hw_ep; | 130 | struct musb_hw_ep *hw_ep = chdat->hw_ep; |
129 | void __iomem *ep_conf = hw_ep->conf; | 131 | void __iomem *ep_conf = hw_ep->conf; |
130 | void __iomem *mbase = musb->mregs; | 132 | void __iomem *mbase = musb->mregs; |
@@ -172,13 +174,15 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) | |||
172 | DBG(3, "Using PIO for remaining %lu bytes\n", pio); | 174 | DBG(3, "Using PIO for remaining %lu bytes\n", pio); |
173 | buf = phys_to_virt((u32)chdat->dma_addr) + chdat->transfer_len; | 175 | buf = phys_to_virt((u32)chdat->dma_addr) + chdat->transfer_len; |
174 | if (chdat->tx) { | 176 | if (chdat->tx) { |
175 | dma_cache_maint(phys_to_virt((u32)chdat->dma_addr), | 177 | dma_unmap_single(dev, chdat->dma_addr, |
176 | chdat->transfer_len, DMA_TO_DEVICE); | 178 | chdat->transfer_len, |
179 | DMA_TO_DEVICE); | ||
177 | musb_write_fifo(hw_ep, pio, buf); | 180 | musb_write_fifo(hw_ep, pio, buf); |
178 | } else { | 181 | } else { |
182 | dma_unmap_single(dev, chdat->dma_addr, | ||
183 | chdat->transfer_len, | ||
184 | DMA_FROM_DEVICE); | ||
179 | musb_read_fifo(hw_ep, pio, buf); | 185 | musb_read_fifo(hw_ep, pio, buf); |
180 | dma_cache_maint(phys_to_virt((u32)chdat->dma_addr), | ||
181 | chdat->transfer_len, DMA_FROM_DEVICE); | ||
182 | } | 186 | } |
183 | channel->actual_len += pio; | 187 | channel->actual_len += pio; |
184 | } | 188 | } |
@@ -223,6 +227,7 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, | |||
223 | struct tusb_omap_dma_ch *chdat = to_chdat(channel); | 227 | struct tusb_omap_dma_ch *chdat = to_chdat(channel); |
224 | struct tusb_omap_dma *tusb_dma = chdat->tusb_dma; | 228 | struct tusb_omap_dma *tusb_dma = chdat->tusb_dma; |
225 | struct musb *musb = chdat->musb; | 229 | struct musb *musb = chdat->musb; |
230 | struct device *dev = musb->controller; | ||
226 | struct musb_hw_ep *hw_ep = chdat->hw_ep; | 231 | struct musb_hw_ep *hw_ep = chdat->hw_ep; |
227 | void __iomem *mbase = musb->mregs; | 232 | void __iomem *mbase = musb->mregs; |
228 | void __iomem *ep_conf = hw_ep->conf; | 233 | void __iomem *ep_conf = hw_ep->conf; |
@@ -298,14 +303,16 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, | |||
298 | chdat->packet_sz = packet_sz; | 303 | chdat->packet_sz = packet_sz; |
299 | chdat->len = len; | 304 | chdat->len = len; |
300 | channel->actual_len = 0; | 305 | channel->actual_len = 0; |
301 | chdat->dma_addr = (void __iomem *)dma_addr; | 306 | chdat->dma_addr = dma_addr; |
302 | channel->status = MUSB_DMA_STATUS_BUSY; | 307 | channel->status = MUSB_DMA_STATUS_BUSY; |
303 | 308 | ||
304 | /* Since we're recycling dma areas, we need to clean or invalidate */ | 309 | /* Since we're recycling dma areas, we need to clean or invalidate */ |
305 | if (chdat->tx) | 310 | if (chdat->tx) |
306 | dma_cache_maint(phys_to_virt(dma_addr), len, DMA_TO_DEVICE); | 311 | dma_map_single(dev, phys_to_virt(dma_addr), len, |
312 | DMA_TO_DEVICE); | ||
307 | else | 313 | else |
308 | dma_cache_maint(phys_to_virt(dma_addr), len, DMA_FROM_DEVICE); | 314 | dma_map_single(dev, phys_to_virt(dma_addr), len, |
315 | DMA_FROM_DEVICE); | ||
309 | 316 | ||
310 | /* Use 16-bit transfer if dma_addr is not 32-bit aligned */ | 317 | /* Use 16-bit transfer if dma_addr is not 32-bit aligned */ |
311 | if ((dma_addr & 0x3) == 0) { | 318 | if ((dma_addr & 0x3) == 0) { |
diff --git a/drivers/usb/otg/gpio_vbus.c b/drivers/usb/otg/gpio_vbus.c index 1c26c94513e9..221c44444ec6 100644 --- a/drivers/usb/otg/gpio_vbus.c +++ b/drivers/usb/otg/gpio_vbus.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
13 | #include <linux/gpio.h> | 13 | #include <linux/gpio.h> |
14 | #include <linux/slab.h> | ||
14 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
15 | #include <linux/usb.h> | 16 | #include <linux/usb.h> |
16 | #include <linux/workqueue.h> | 17 | #include <linux/workqueue.h> |
diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c index af456b48985f..e70014ab0976 100644 --- a/drivers/usb/otg/nop-usb-xceiv.c +++ b/drivers/usb/otg/nop-usb-xceiv.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/platform_device.h> | 30 | #include <linux/platform_device.h> |
31 | #include <linux/dma-mapping.h> | 31 | #include <linux/dma-mapping.h> |
32 | #include <linux/usb/otg.h> | 32 | #include <linux/usb/otg.h> |
33 | #include <linux/slab.h> | ||
33 | 34 | ||
34 | struct nop_usb_xceiv { | 35 | struct nop_usb_xceiv { |
35 | struct otg_transceiver otg; | 36 | struct otg_transceiver otg; |
diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c index 3e4e9f434d78..223cdf46ccb7 100644 --- a/drivers/usb/otg/twl4030-usb.c +++ b/drivers/usb/otg/twl4030-usb.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/regulator/consumer.h> | 37 | #include <linux/regulator/consumer.h> |
38 | #include <linux/err.h> | 38 | #include <linux/err.h> |
39 | #include <linux/notifier.h> | 39 | #include <linux/notifier.h> |
40 | #include <linux/slab.h> | ||
40 | 41 | ||
41 | /* Register defines */ | 42 | /* Register defines */ |
42 | 43 | ||
diff --git a/drivers/usb/otg/ulpi.c b/drivers/usb/otg/ulpi.c index 896527456b7e..9010225e0d06 100644 --- a/drivers/usb/otg/ulpi.c +++ b/drivers/usb/otg/ulpi.c | |||
@@ -24,6 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
27 | #include <linux/slab.h> | ||
27 | #include <linux/usb.h> | 28 | #include <linux/usb.h> |
28 | #include <linux/usb/otg.h> | 29 | #include <linux/usb/otg.h> |
29 | #include <linux/usb/ulpi.h> | 30 | #include <linux/usb/ulpi.h> |
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig index c78b255e3f83..a0ecb42cb33a 100644 --- a/drivers/usb/serial/Kconfig +++ b/drivers/usb/serial/Kconfig | |||
@@ -474,14 +474,14 @@ config USB_SERIAL_OTI6858 | |||
474 | 474 | ||
475 | config USB_SERIAL_QCAUX | 475 | config USB_SERIAL_QCAUX |
476 | tristate "USB Qualcomm Auxiliary Serial Port Driver" | 476 | tristate "USB Qualcomm Auxiliary Serial Port Driver" |
477 | ---help--- | 477 | help |
478 | Say Y here if you want to use the auxiliary serial ports provided | 478 | Say Y here if you want to use the auxiliary serial ports provided |
479 | by many modems based on Qualcomm chipsets. These ports often use | 479 | by many modems based on Qualcomm chipsets. These ports often use |
480 | a proprietary protocol called DM and cannot be used for AT- or | 480 | a proprietary protocol called DM and cannot be used for AT- or |
481 | PPP-based communication. | 481 | PPP-based communication. |
482 | 482 | ||
483 | To compile this driver as a module, choose M here: the | 483 | To compile this driver as a module, choose M here: the |
484 | module will be called moto_modem. If unsure, choose N. | 484 | module will be called qcaux. If unsure, choose N. |
485 | 485 | ||
486 | config USB_SERIAL_QUALCOMM | 486 | config USB_SERIAL_QUALCOMM |
487 | tristate "USB Qualcomm Serial modem" | 487 | tristate "USB Qualcomm Serial modem" |
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c index 365db1097bfd..4fd7af98b1ae 100644 --- a/drivers/usb/serial/aircable.c +++ b/drivers/usb/serial/aircable.c | |||
@@ -43,6 +43,7 @@ | |||
43 | */ | 43 | */ |
44 | 44 | ||
45 | #include <linux/tty.h> | 45 | #include <linux/tty.h> |
46 | #include <linux/slab.h> | ||
46 | #include <linux/tty_flip.h> | 47 | #include <linux/tty_flip.h> |
47 | #include <linux/circ_buf.h> | 48 | #include <linux/circ_buf.h> |
48 | #include <linux/usb.h> | 49 | #include <linux/usb.h> |
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c index 547c9448c28c..9b66bf19f751 100644 --- a/drivers/usb/serial/ark3116.c +++ b/drivers/usb/serial/ark3116.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/init.h> | 26 | #include <linux/init.h> |
27 | #include <linux/ioctl.h> | 27 | #include <linux/ioctl.h> |
28 | #include <linux/tty.h> | 28 | #include <linux/tty.h> |
29 | #include <linux/slab.h> | ||
29 | #include <linux/tty_flip.h> | 30 | #include <linux/tty_flip.h> |
30 | #include <linux/module.h> | 31 | #include <linux/module.h> |
31 | #include <linux/usb.h> | 32 | #include <linux/usb.h> |
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c index ba555c528cc6..7f547dc3a590 100644 --- a/drivers/usb/serial/bus.c +++ b/drivers/usb/serial/bus.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/tty.h> | 13 | #include <linux/tty.h> |
14 | #include <linux/slab.h> | ||
14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
15 | #include <linux/usb.h> | 16 | #include <linux/usb.h> |
16 | #include <linux/usb/serial.h> | 17 | #include <linux/usb/serial.h> |
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index 9f4fed1968b5..7e8e39818414 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/tty.h> | 20 | #include <linux/tty.h> |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include <linux/slab.h> | ||
22 | #include <linux/usb.h> | 23 | #include <linux/usb.h> |
23 | #include <linux/usb/serial.h> | 24 | #include <linux/usb/serial.h> |
24 | #include <linux/serial.h> | 25 | #include <linux/serial.h> |
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index b22ac3258523..f347da2ef00a 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c | |||
@@ -181,6 +181,7 @@ static int usb_console_setup(struct console *co, char *options) | |||
181 | /* The console is special in terms of closing the device so | 181 | /* The console is special in terms of closing the device so |
182 | * indicate this port is now acting as a system console. */ | 182 | * indicate this port is now acting as a system console. */ |
183 | port->console = 1; | 183 | port->console = 1; |
184 | port->port.console = 1; | ||
184 | 185 | ||
185 | mutex_unlock(&serial->disc_mutex); | 186 | mutex_unlock(&serial->disc_mutex); |
186 | return retval; | 187 | return retval; |
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 507382b0a9ed..ec9b0449ccf6 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
@@ -313,11 +313,6 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request, | |||
313 | return -EPROTO; | 313 | return -EPROTO; |
314 | } | 314 | } |
315 | 315 | ||
316 | /* Single data value */ | ||
317 | result = usb_control_msg(serial->dev, | ||
318 | usb_sndctrlpipe(serial->dev, 0), | ||
319 | request, REQTYPE_HOST_TO_DEVICE, data[0], | ||
320 | 0, NULL, 0, 300); | ||
321 | return 0; | 316 | return 0; |
322 | } | 317 | } |
323 | 318 | ||
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index baf74b44e6ed..e23c77925e7a 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c | |||
@@ -152,7 +152,7 @@ struct cypress_private { | |||
152 | int isthrottled; /* if throttled, discard reads */ | 152 | int isthrottled; /* if throttled, discard reads */ |
153 | wait_queue_head_t delta_msr_wait; /* used for TIOCMIWAIT */ | 153 | wait_queue_head_t delta_msr_wait; /* used for TIOCMIWAIT */ |
154 | char prev_status, diff_status; /* used for TIOCMIWAIT */ | 154 | char prev_status, diff_status; /* used for TIOCMIWAIT */ |
155 | /* we pass a pointer to this as the arguement sent to | 155 | /* we pass a pointer to this as the argument sent to |
156 | cypress_set_termios old_termios */ | 156 | cypress_set_termios old_termios */ |
157 | struct ktermios tmp_termios; /* stores the old termios settings */ | 157 | struct ktermios tmp_termios; /* stores the old termios settings */ |
158 | }; | 158 | }; |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 6af0dfa5f5ac..1d7c4fac02e8 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -91,7 +91,7 @@ struct ftdi_private { | |||
91 | unsigned long tx_outstanding_bytes; | 91 | unsigned long tx_outstanding_bytes; |
92 | unsigned long tx_outstanding_urbs; | 92 | unsigned long tx_outstanding_urbs; |
93 | unsigned short max_packet_size; | 93 | unsigned short max_packet_size; |
94 | struct mutex cfg_lock; /* Avoid mess by parallel calls of config ioctl() */ | 94 | struct mutex cfg_lock; /* Avoid mess by parallel calls of config ioctl() and change_speed() */ |
95 | }; | 95 | }; |
96 | 96 | ||
97 | /* struct ftdi_sio_quirk is used by devices requiring special attention. */ | 97 | /* struct ftdi_sio_quirk is used by devices requiring special attention. */ |
@@ -658,6 +658,7 @@ static struct usb_device_id id_table_combined [] = { | |||
658 | { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, | 658 | { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, |
659 | { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, | 659 | { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, |
660 | { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, | 660 | { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, |
661 | { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, | ||
661 | { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, | 662 | { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, |
662 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, | 663 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, |
663 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, | 664 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, |
@@ -1272,8 +1273,8 @@ check_and_exit: | |||
1272 | (priv->flags & ASYNC_SPD_MASK)) || | 1273 | (priv->flags & ASYNC_SPD_MASK)) || |
1273 | (((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && | 1274 | (((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && |
1274 | (old_priv.custom_divisor != priv->custom_divisor))) { | 1275 | (old_priv.custom_divisor != priv->custom_divisor))) { |
1275 | mutex_unlock(&priv->cfg_lock); | ||
1276 | change_speed(tty, port); | 1276 | change_speed(tty, port); |
1277 | mutex_unlock(&priv->cfg_lock); | ||
1277 | } | 1278 | } |
1278 | else | 1279 | else |
1279 | mutex_unlock(&priv->cfg_lock); | 1280 | mutex_unlock(&priv->cfg_lock); |
@@ -2264,9 +2265,11 @@ static void ftdi_set_termios(struct tty_struct *tty, | |||
2264 | clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); | 2265 | clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); |
2265 | } else { | 2266 | } else { |
2266 | /* set the baudrate determined before */ | 2267 | /* set the baudrate determined before */ |
2268 | mutex_lock(&priv->cfg_lock); | ||
2267 | if (change_speed(tty, port)) | 2269 | if (change_speed(tty, port)) |
2268 | dev_err(&port->dev, "%s urb failed to set baudrate\n", | 2270 | dev_err(&port->dev, "%s urb failed to set baudrate\n", |
2269 | __func__); | 2271 | __func__); |
2272 | mutex_unlock(&priv->cfg_lock); | ||
2270 | /* Ensure RTS and DTR are raised when baudrate changed from 0 */ | 2273 | /* Ensure RTS and DTR are raised when baudrate changed from 0 */ |
2271 | if (!old_termios || (old_termios->c_cflag & CBAUD) == B0) | 2274 | if (!old_termios || (old_termios->c_cflag & CBAUD) == B0) |
2272 | set_mctrl(port, TIOCM_DTR | TIOCM_RTS); | 2275 | set_mctrl(port, TIOCM_DTR | TIOCM_RTS); |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 0727e198503e..75482cbc3998 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -501,6 +501,13 @@ | |||
501 | #define CONTEC_COM1USBH_PID 0x8311 /* COM-1(USB)H */ | 501 | #define CONTEC_COM1USBH_PID 0x8311 /* COM-1(USB)H */ |
502 | 502 | ||
503 | /* | 503 | /* |
504 | * Contec products (http://www.contec.com) | ||
505 | * Submitted by Daniel Sangorrin | ||
506 | */ | ||
507 | #define CONTEC_VID 0x06CE /* Vendor ID */ | ||
508 | #define CONTEC_COM1USBH_PID 0x8311 /* COM-1(USB)H */ | ||
509 | |||
510 | /* | ||
504 | * Definitions for B&B Electronics products. | 511 | * Definitions for B&B Electronics products. |
505 | */ | 512 | */ |
506 | #define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */ | 513 | #define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */ |
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 89fac36684c5..f804acb138ec 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
@@ -130,7 +130,7 @@ int usb_serial_generic_open(struct tty_struct *tty, struct usb_serial_port *port | |||
130 | spin_unlock_irqrestore(&port->lock, flags); | 130 | spin_unlock_irqrestore(&port->lock, flags); |
131 | 131 | ||
132 | /* if we have a bulk endpoint, start reading from it */ | 132 | /* if we have a bulk endpoint, start reading from it */ |
133 | if (serial->num_bulk_in) { | 133 | if (port->bulk_in_size) { |
134 | /* Start reading from the device */ | 134 | /* Start reading from the device */ |
135 | usb_fill_bulk_urb(port->read_urb, serial->dev, | 135 | usb_fill_bulk_urb(port->read_urb, serial->dev, |
136 | usb_rcvbulkpipe(serial->dev, | 136 | usb_rcvbulkpipe(serial->dev, |
@@ -159,10 +159,10 @@ static void generic_cleanup(struct usb_serial_port *port) | |||
159 | dbg("%s - port %d", __func__, port->number); | 159 | dbg("%s - port %d", __func__, port->number); |
160 | 160 | ||
161 | if (serial->dev) { | 161 | if (serial->dev) { |
162 | /* shutdown any bulk reads that might be going on */ | 162 | /* shutdown any bulk transfers that might be going on */ |
163 | if (serial->num_bulk_out) | 163 | if (port->bulk_out_size) |
164 | usb_kill_urb(port->write_urb); | 164 | usb_kill_urb(port->write_urb); |
165 | if (serial->num_bulk_in) | 165 | if (port->bulk_in_size) |
166 | usb_kill_urb(port->read_urb); | 166 | usb_kill_urb(port->read_urb); |
167 | } | 167 | } |
168 | } | 168 | } |
@@ -333,15 +333,15 @@ int usb_serial_generic_write(struct tty_struct *tty, | |||
333 | 333 | ||
334 | dbg("%s - port %d", __func__, port->number); | 334 | dbg("%s - port %d", __func__, port->number); |
335 | 335 | ||
336 | /* only do something if we have a bulk out endpoint */ | ||
337 | if (!port->bulk_out_size) | ||
338 | return -ENODEV; | ||
339 | |||
336 | if (count == 0) { | 340 | if (count == 0) { |
337 | dbg("%s - write request of 0 bytes", __func__); | 341 | dbg("%s - write request of 0 bytes", __func__); |
338 | return 0; | 342 | return 0; |
339 | } | 343 | } |
340 | 344 | ||
341 | /* only do something if we have a bulk out endpoint */ | ||
342 | if (!serial->num_bulk_out) | ||
343 | return 0; | ||
344 | |||
345 | if (serial->type->max_in_flight_urbs) | 345 | if (serial->type->max_in_flight_urbs) |
346 | return usb_serial_multi_urb_write(tty, port, | 346 | return usb_serial_multi_urb_write(tty, port, |
347 | buf, count); | 347 | buf, count); |
@@ -364,14 +364,19 @@ int usb_serial_generic_write_room(struct tty_struct *tty) | |||
364 | int room = 0; | 364 | int room = 0; |
365 | 365 | ||
366 | dbg("%s - port %d", __func__, port->number); | 366 | dbg("%s - port %d", __func__, port->number); |
367 | |||
368 | if (!port->bulk_out_size) | ||
369 | return 0; | ||
370 | |||
367 | spin_lock_irqsave(&port->lock, flags); | 371 | spin_lock_irqsave(&port->lock, flags); |
368 | if (serial->type->max_in_flight_urbs) { | 372 | if (serial->type->max_in_flight_urbs) { |
369 | if (port->urbs_in_flight < serial->type->max_in_flight_urbs) | 373 | if (port->urbs_in_flight < serial->type->max_in_flight_urbs) |
370 | room = port->bulk_out_size * | 374 | room = port->bulk_out_size * |
371 | (serial->type->max_in_flight_urbs - | 375 | (serial->type->max_in_flight_urbs - |
372 | port->urbs_in_flight); | 376 | port->urbs_in_flight); |
373 | } else if (serial->num_bulk_out) | 377 | } else { |
374 | room = kfifo_avail(&port->write_fifo); | 378 | room = kfifo_avail(&port->write_fifo); |
379 | } | ||
375 | spin_unlock_irqrestore(&port->lock, flags); | 380 | spin_unlock_irqrestore(&port->lock, flags); |
376 | 381 | ||
377 | dbg("%s - returns %d", __func__, room); | 382 | dbg("%s - returns %d", __func__, room); |
@@ -382,15 +387,18 @@ int usb_serial_generic_chars_in_buffer(struct tty_struct *tty) | |||
382 | { | 387 | { |
383 | struct usb_serial_port *port = tty->driver_data; | 388 | struct usb_serial_port *port = tty->driver_data; |
384 | struct usb_serial *serial = port->serial; | 389 | struct usb_serial *serial = port->serial; |
385 | int chars = 0; | ||
386 | unsigned long flags; | 390 | unsigned long flags; |
391 | int chars; | ||
387 | 392 | ||
388 | dbg("%s - port %d", __func__, port->number); | 393 | dbg("%s - port %d", __func__, port->number); |
389 | 394 | ||
395 | if (!port->bulk_out_size) | ||
396 | return 0; | ||
397 | |||
390 | spin_lock_irqsave(&port->lock, flags); | 398 | spin_lock_irqsave(&port->lock, flags); |
391 | if (serial->type->max_in_flight_urbs) | 399 | if (serial->type->max_in_flight_urbs) |
392 | chars = port->tx_bytes_flight; | 400 | chars = port->tx_bytes_flight; |
393 | else if (serial->num_bulk_out) | 401 | else |
394 | chars = kfifo_len(&port->write_fifo); | 402 | chars = kfifo_len(&port->write_fifo); |
395 | spin_unlock_irqrestore(&port->lock, flags); | 403 | spin_unlock_irqrestore(&port->lock, flags); |
396 | 404 | ||
@@ -415,11 +423,13 @@ void usb_serial_generic_resubmit_read_urb(struct usb_serial_port *port, | |||
415 | ((serial->type->read_bulk_callback) ? | 423 | ((serial->type->read_bulk_callback) ? |
416 | serial->type->read_bulk_callback : | 424 | serial->type->read_bulk_callback : |
417 | usb_serial_generic_read_bulk_callback), port); | 425 | usb_serial_generic_read_bulk_callback), port); |
426 | |||
418 | result = usb_submit_urb(urb, mem_flags); | 427 | result = usb_submit_urb(urb, mem_flags); |
419 | if (result) | 428 | if (result && result != -EPERM) { |
420 | dev_err(&port->dev, | 429 | dev_err(&port->dev, |
421 | "%s - failed resubmitting read urb, error %d\n", | 430 | "%s - failed resubmitting read urb, error %d\n", |
422 | __func__, result); | 431 | __func__, result); |
432 | } | ||
423 | } | 433 | } |
424 | EXPORT_SYMBOL_GPL(usb_serial_generic_resubmit_read_urb); | 434 | EXPORT_SYMBOL_GPL(usb_serial_generic_resubmit_read_urb); |
425 | 435 | ||
@@ -498,23 +508,18 @@ void usb_serial_generic_write_bulk_callback(struct urb *urb) | |||
498 | if (port->urbs_in_flight < 0) | 508 | if (port->urbs_in_flight < 0) |
499 | port->urbs_in_flight = 0; | 509 | port->urbs_in_flight = 0; |
500 | spin_unlock_irqrestore(&port->lock, flags); | 510 | spin_unlock_irqrestore(&port->lock, flags); |
501 | |||
502 | if (status) { | ||
503 | dbg("%s - nonzero multi-urb write bulk status " | ||
504 | "received: %d", __func__, status); | ||
505 | return; | ||
506 | } | ||
507 | } else { | 511 | } else { |
508 | port->write_urb_busy = 0; | 512 | port->write_urb_busy = 0; |
509 | 513 | ||
510 | if (status) { | 514 | if (status) |
511 | dbg("%s - nonzero multi-urb write bulk status " | ||
512 | "received: %d", __func__, status); | ||
513 | kfifo_reset_out(&port->write_fifo); | 515 | kfifo_reset_out(&port->write_fifo); |
514 | } else | 516 | else |
515 | usb_serial_generic_write_start(port); | 517 | usb_serial_generic_write_start(port); |
516 | } | 518 | } |
517 | 519 | ||
520 | if (status) | ||
521 | dbg("%s - non-zero urb status: %d", __func__, status); | ||
522 | |||
518 | usb_serial_port_softint(port); | 523 | usb_serial_port_softint(port); |
519 | } | 524 | } |
520 | EXPORT_SYMBOL_GPL(usb_serial_generic_write_bulk_callback); | 525 | EXPORT_SYMBOL_GPL(usb_serial_generic_write_bulk_callback); |
diff --git a/drivers/usb/serial/navman.c b/drivers/usb/serial/navman.c index 04a6cbbed2c0..a6b207c84917 100644 --- a/drivers/usb/serial/navman.c +++ b/drivers/usb/serial/navman.c | |||
@@ -12,6 +12,7 @@ | |||
12 | * flags as the navman is rx only so cannot echo. | 12 | * flags as the navman is rx only so cannot echo. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/gfp.h> | ||
15 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
16 | #include <linux/init.h> | 17 | #include <linux/init.h> |
17 | #include <linux/tty.h> | 18 | #include <linux/tty.h> |
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c index f37476e22684..ed01f3b2de8c 100644 --- a/drivers/usb/serial/opticon.c +++ b/drivers/usb/serial/opticon.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/tty.h> | 14 | #include <linux/tty.h> |
15 | #include <linux/tty_driver.h> | 15 | #include <linux/tty_driver.h> |
16 | #include <linux/slab.h> | ||
16 | #include <linux/tty_flip.h> | 17 | #include <linux/tty_flip.h> |
17 | #include <linux/serial.h> | 18 | #include <linux/serial.h> |
18 | #include <linux/module.h> | 19 | #include <linux/module.h> |
@@ -115,7 +116,7 @@ static void opticon_bulk_callback(struct urb *urb) | |||
115 | } | 116 | } |
116 | } else { | 117 | } else { |
117 | dev_dbg(&priv->udev->dev, | 118 | dev_dbg(&priv->udev->dev, |
118 | "Improper ammount of data received from the device, " | 119 | "Improper amount of data received from the device, " |
119 | "%d bytes", urb->actual_length); | 120 | "%d bytes", urb->actual_length); |
120 | } | 121 | } |
121 | 122 | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 847b805d63a3..84d0edad8e4f 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/errno.h> | 37 | #include <linux/errno.h> |
38 | #include <linux/tty.h> | 38 | #include <linux/tty.h> |
39 | #include <linux/tty_flip.h> | 39 | #include <linux/tty_flip.h> |
40 | #include <linux/slab.h> | ||
40 | #include <linux/module.h> | 41 | #include <linux/module.h> |
41 | #include <linux/bitops.h> | 42 | #include <linux/bitops.h> |
42 | #include <linux/usb.h> | 43 | #include <linux/usb.h> |
@@ -288,7 +289,9 @@ static int option_resume(struct usb_serial *serial); | |||
288 | 289 | ||
289 | #define QUALCOMM_VENDOR_ID 0x05C6 | 290 | #define QUALCOMM_VENDOR_ID 0x05C6 |
290 | 291 | ||
291 | #define MAXON_VENDOR_ID 0x16d8 | 292 | #define CMOTECH_VENDOR_ID 0x16d8 |
293 | #define CMOTECH_PRODUCT_6008 0x6008 | ||
294 | #define CMOTECH_PRODUCT_6280 0x6280 | ||
292 | 295 | ||
293 | #define TELIT_VENDOR_ID 0x1bc7 | 296 | #define TELIT_VENDOR_ID 0x1bc7 |
294 | #define TELIT_PRODUCT_UC864E 0x1003 | 297 | #define TELIT_PRODUCT_UC864E 0x1003 |
@@ -302,6 +305,11 @@ static int option_resume(struct usb_serial *serial); | |||
302 | #define ZTE_PRODUCT_CDMA_TECH 0xfffe | 305 | #define ZTE_PRODUCT_CDMA_TECH 0xfffe |
303 | #define ZTE_PRODUCT_AC8710 0xfff1 | 306 | #define ZTE_PRODUCT_AC8710 0xfff1 |
304 | #define ZTE_PRODUCT_AC2726 0xfff5 | 307 | #define ZTE_PRODUCT_AC2726 0xfff5 |
308 | #define ZTE_PRODUCT_AC8710T 0xffff | ||
309 | |||
310 | /* ZTE PRODUCTS -- alternate vendor ID */ | ||
311 | #define ZTE_VENDOR_ID2 0x1d6b | ||
312 | #define ZTE_PRODUCT_MF_330 0x0002 | ||
305 | 313 | ||
306 | #define BENQ_VENDOR_ID 0x04a5 | 314 | #define BENQ_VENDOR_ID 0x04a5 |
307 | #define BENQ_PRODUCT_H10 0x4068 | 315 | #define BENQ_PRODUCT_H10 0x4068 |
@@ -309,6 +317,7 @@ static int option_resume(struct usb_serial *serial); | |||
309 | #define DLINK_VENDOR_ID 0x1186 | 317 | #define DLINK_VENDOR_ID 0x1186 |
310 | #define DLINK_PRODUCT_DWM_652 0x3e04 | 318 | #define DLINK_PRODUCT_DWM_652 0x3e04 |
311 | #define DLINK_PRODUCT_DWM_652_U5 0xce16 | 319 | #define DLINK_PRODUCT_DWM_652_U5 0xce16 |
320 | #define DLINK_PRODUCT_DWM_652_U5A 0xce1e | ||
312 | 321 | ||
313 | #define QISDA_VENDOR_ID 0x1da5 | 322 | #define QISDA_VENDOR_ID 0x1da5 |
314 | #define QISDA_PRODUCT_H21_4512 0x4512 | 323 | #define QISDA_PRODUCT_H21_4512 0x4512 |
@@ -332,6 +341,24 @@ static int option_resume(struct usb_serial *serial); | |||
332 | #define ALCATEL_VENDOR_ID 0x1bbb | 341 | #define ALCATEL_VENDOR_ID 0x1bbb |
333 | #define ALCATEL_PRODUCT_X060S 0x0000 | 342 | #define ALCATEL_PRODUCT_X060S 0x0000 |
334 | 343 | ||
344 | #define PIRELLI_VENDOR_ID 0x1266 | ||
345 | #define PIRELLI_PRODUCT_C100_1 0x1002 | ||
346 | #define PIRELLI_PRODUCT_C100_2 0x1003 | ||
347 | #define PIRELLI_PRODUCT_1004 0x1004 | ||
348 | #define PIRELLI_PRODUCT_1005 0x1005 | ||
349 | #define PIRELLI_PRODUCT_1006 0x1006 | ||
350 | #define PIRELLI_PRODUCT_1007 0x1007 | ||
351 | #define PIRELLI_PRODUCT_1008 0x1008 | ||
352 | #define PIRELLI_PRODUCT_1009 0x1009 | ||
353 | #define PIRELLI_PRODUCT_100A 0x100a | ||
354 | #define PIRELLI_PRODUCT_100B 0x100b | ||
355 | #define PIRELLI_PRODUCT_100C 0x100c | ||
356 | #define PIRELLI_PRODUCT_100D 0x100d | ||
357 | #define PIRELLI_PRODUCT_100E 0x100e | ||
358 | #define PIRELLI_PRODUCT_100F 0x100f | ||
359 | #define PIRELLI_PRODUCT_1011 0x1011 | ||
360 | #define PIRELLI_PRODUCT_1012 0x1012 | ||
361 | |||
335 | /* Airplus products */ | 362 | /* Airplus products */ |
336 | #define AIRPLUS_VENDOR_ID 0x1011 | 363 | #define AIRPLUS_VENDOR_ID 0x1011 |
337 | #define AIRPLUS_PRODUCT_MCD650 0x3198 | 364 | #define AIRPLUS_PRODUCT_MCD650 0x3198 |
@@ -351,6 +378,8 @@ static int option_resume(struct usb_serial *serial); | |||
351 | #define HAIER_VENDOR_ID 0x201e | 378 | #define HAIER_VENDOR_ID 0x201e |
352 | #define HAIER_PRODUCT_CE100 0x2009 | 379 | #define HAIER_PRODUCT_CE100 0x2009 |
353 | 380 | ||
381 | #define CINTERION_VENDOR_ID 0x0681 | ||
382 | |||
354 | /* some devices interfaces need special handling due to a number of reasons */ | 383 | /* some devices interfaces need special handling due to a number of reasons */ |
355 | enum option_blacklist_reason { | 384 | enum option_blacklist_reason { |
356 | OPTION_BLACKLIST_NONE = 0, | 385 | OPTION_BLACKLIST_NONE = 0, |
@@ -547,7 +576,8 @@ static const struct usb_device_id option_ids[] = { | |||
547 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, | 576 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, |
548 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ | 577 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ |
549 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ | 578 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ |
550 | { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ | 579 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */ |
580 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6008) }, | ||
551 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, | 581 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, |
552 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864G) }, | 582 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864G) }, |
553 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */ | 583 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */ |
@@ -656,9 +686,12 @@ static const struct usb_device_id option_ids[] = { | |||
656 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, | 686 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, |
657 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, | 687 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, |
658 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, | 688 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, |
689 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) }, | ||
690 | { USB_DEVICE(ZTE_VENDOR_ID2, ZTE_PRODUCT_MF_330) }, | ||
659 | { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, | 691 | { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, |
660 | { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, | 692 | { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, |
661 | { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */ | 693 | { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */ |
694 | { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5A) }, | ||
662 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) }, | 695 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) }, |
663 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) }, | 696 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) }, |
664 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) }, | 697 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) }, |
@@ -666,7 +699,6 @@ static const struct usb_device_id option_ids[] = { | |||
666 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) }, | 699 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) }, |
667 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */ | 700 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */ |
668 | { USB_DEVICE(ALINK_VENDOR_ID, 0x9000) }, | 701 | { USB_DEVICE(ALINK_VENDOR_ID, 0x9000) }, |
669 | { USB_DEVICE(ALINK_VENDOR_ID, 0xce16) }, | ||
670 | { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, | 702 | { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, |
671 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, | 703 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, |
672 | { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, | 704 | { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, |
@@ -675,6 +707,25 @@ static const struct usb_device_id option_ids[] = { | |||
675 | .driver_info = (kernel_ulong_t)&four_g_w14_blacklist | 707 | .driver_info = (kernel_ulong_t)&four_g_w14_blacklist |
676 | }, | 708 | }, |
677 | { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) }, | 709 | { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) }, |
710 | /* Pirelli */ | ||
711 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1)}, | ||
712 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_2)}, | ||
713 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1004)}, | ||
714 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1005)}, | ||
715 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1006)}, | ||
716 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1007)}, | ||
717 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1008)}, | ||
718 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1009)}, | ||
719 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100A)}, | ||
720 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100B) }, | ||
721 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100C) }, | ||
722 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100D) }, | ||
723 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100E) }, | ||
724 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) }, | ||
725 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)}, | ||
726 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)}, | ||
727 | |||
728 | { USB_DEVICE(CINTERION_VENDOR_ID, 0x0047) }, | ||
678 | { } /* Terminating entry */ | 729 | { } /* Terminating entry */ |
679 | }; | 730 | }; |
680 | MODULE_DEVICE_TABLE(usb, option_ids); | 731 | MODULE_DEVICE_TABLE(usb, option_ids); |
@@ -798,12 +849,19 @@ static int option_probe(struct usb_serial *serial, | |||
798 | const struct usb_device_id *id) | 849 | const struct usb_device_id *id) |
799 | { | 850 | { |
800 | struct option_intf_private *data; | 851 | struct option_intf_private *data; |
852 | |||
801 | /* D-Link DWM 652 still exposes CD-Rom emulation interface in modem mode */ | 853 | /* D-Link DWM 652 still exposes CD-Rom emulation interface in modem mode */ |
802 | if (serial->dev->descriptor.idVendor == DLINK_VENDOR_ID && | 854 | if (serial->dev->descriptor.idVendor == DLINK_VENDOR_ID && |
803 | serial->dev->descriptor.idProduct == DLINK_PRODUCT_DWM_652 && | 855 | serial->dev->descriptor.idProduct == DLINK_PRODUCT_DWM_652 && |
804 | serial->interface->cur_altsetting->desc.bInterfaceClass == 0x8) | 856 | serial->interface->cur_altsetting->desc.bInterfaceClass == 0x8) |
805 | return -ENODEV; | 857 | return -ENODEV; |
806 | 858 | ||
859 | /* Bandrich modem and AT command interface is 0xff */ | ||
860 | if ((serial->dev->descriptor.idVendor == BANDRICH_VENDOR_ID || | ||
861 | serial->dev->descriptor.idVendor == PIRELLI_VENDOR_ID) && | ||
862 | serial->interface->cur_altsetting->desc.bInterfaceClass != 0xff) | ||
863 | return -ENODEV; | ||
864 | |||
807 | data = serial->private = kzalloc(sizeof(struct option_intf_private), GFP_KERNEL); | 865 | data = serial->private = kzalloc(sizeof(struct option_intf_private), GFP_KERNEL); |
808 | if (!data) | 866 | if (!data) |
809 | return -ENOMEM; | 867 | return -ENOMEM; |
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 73d5f346d3e0..c28b1607eacc 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c | |||
@@ -59,6 +59,7 @@ static const struct usb_device_id id_table[] = { | |||
59 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) }, | 59 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) }, |
60 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) }, | 60 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) }, |
61 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) }, | 61 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) }, |
62 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) }, | ||
62 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, | 63 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, |
63 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, | 64 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, |
64 | { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, | 65 | { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, |
@@ -97,6 +98,7 @@ static const struct usb_device_id id_table[] = { | |||
97 | { USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) }, | 98 | { USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) }, |
98 | { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) }, | 99 | { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) }, |
99 | { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) }, | 100 | { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) }, |
101 | { USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) }, | ||
100 | { } /* Terminating entry */ | 102 | { } /* Terminating entry */ |
101 | }; | 103 | }; |
102 | 104 | ||
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h index d640dc951568..23c09b38b9ec 100644 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #define PL2303_PRODUCT_ID_ALDIGA 0x0611 | 20 | #define PL2303_PRODUCT_ID_ALDIGA 0x0611 |
21 | #define PL2303_PRODUCT_ID_MMX 0x0612 | 21 | #define PL2303_PRODUCT_ID_MMX 0x0612 |
22 | #define PL2303_PRODUCT_ID_GPRS 0x0609 | 22 | #define PL2303_PRODUCT_ID_GPRS 0x0609 |
23 | #define PL2303_PRODUCT_ID_HCR331 0x331a | ||
23 | 24 | ||
24 | #define ATEN_VENDOR_ID 0x0557 | 25 | #define ATEN_VENDOR_ID 0x0557 |
25 | #define ATEN_VENDOR_ID2 0x0547 | 26 | #define ATEN_VENDOR_ID2 0x0547 |
@@ -134,3 +135,7 @@ | |||
134 | /* Sanwa KB-USB2 multimeter cable (ID: 11ad:0001) */ | 135 | /* Sanwa KB-USB2 multimeter cable (ID: 11ad:0001) */ |
135 | #define SANWA_VENDOR_ID 0x11ad | 136 | #define SANWA_VENDOR_ID 0x11ad |
136 | #define SANWA_PRODUCT_ID 0x0001 | 137 | #define SANWA_PRODUCT_ID 0x0001 |
138 | |||
139 | /* ADLINK ND-6530 RS232,RS485 and RS422 adapter */ | ||
140 | #define ADLINK_VENDOR_ID 0x0b63 | ||
141 | #define ADLINK_ND6530_PRODUCT_ID 0x6530 | ||
diff --git a/drivers/usb/serial/qcaux.c b/drivers/usb/serial/qcaux.c index 0b9362061713..7e3bea23600b 100644 --- a/drivers/usb/serial/qcaux.c +++ b/drivers/usb/serial/qcaux.c | |||
@@ -42,6 +42,14 @@ | |||
42 | #define CMOTECH_PRODUCT_CDU550 0x5553 | 42 | #define CMOTECH_PRODUCT_CDU550 0x5553 |
43 | #define CMOTECH_PRODUCT_CDX650 0x6512 | 43 | #define CMOTECH_PRODUCT_CDX650 0x6512 |
44 | 44 | ||
45 | /* LG devices */ | ||
46 | #define LG_VENDOR_ID 0x1004 | ||
47 | #define LG_PRODUCT_VX4400_6000 0x6000 /* VX4400/VX6000/Rumor */ | ||
48 | |||
49 | /* Sanyo devices */ | ||
50 | #define SANYO_VENDOR_ID 0x0474 | ||
51 | #define SANYO_PRODUCT_KATANA_LX 0x0754 /* SCP-3800 (Katana LX) */ | ||
52 | |||
45 | static struct usb_device_id id_table[] = { | 53 | static struct usb_device_id id_table[] = { |
46 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5740, 0xff, 0x00, 0x00) }, | 54 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5740, 0xff, 0x00, 0x00) }, |
47 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5750, 0xff, 0x00, 0x00) }, | 55 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5750, 0xff, 0x00, 0x00) }, |
@@ -51,6 +59,8 @@ static struct usb_device_id id_table[] = { | |||
51 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_ALLTEL, 0xff, 0x00, 0x00) }, | 59 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_ALLTEL, 0xff, 0x00, 0x00) }, |
52 | { USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDU550, 0xff, 0xff, 0x00) }, | 60 | { USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDU550, 0xff, 0xff, 0x00) }, |
53 | { USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDX650, 0xff, 0xff, 0x00) }, | 61 | { USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDX650, 0xff, 0xff, 0x00) }, |
62 | { USB_DEVICE_AND_INTERFACE_INFO(LG_VENDOR_ID, LG_PRODUCT_VX4400_6000, 0xff, 0xff, 0x00) }, | ||
63 | { USB_DEVICE_AND_INTERFACE_INFO(SANYO_VENDOR_ID, SANYO_PRODUCT_KATANA_LX, 0xff, 0xff, 0x00) }, | ||
54 | { }, | 64 | { }, |
55 | }; | 65 | }; |
56 | MODULE_DEVICE_TABLE(usb, id_table); | 66 | MODULE_DEVICE_TABLE(usb, id_table); |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 310ff6ec6567..53a2d5a935a2 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -47,6 +47,35 @@ static const struct usb_device_id id_table[] = { | |||
47 | {USB_DEVICE(0x05c6, 0x9221)}, /* Generic Gobi QDL device */ | 47 | {USB_DEVICE(0x05c6, 0x9221)}, /* Generic Gobi QDL device */ |
48 | {USB_DEVICE(0x05c6, 0x9231)}, /* Generic Gobi QDL device */ | 48 | {USB_DEVICE(0x05c6, 0x9231)}, /* Generic Gobi QDL device */ |
49 | {USB_DEVICE(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ | 49 | {USB_DEVICE(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ |
50 | {USB_DEVICE(0x413c, 0x8185)}, /* Dell Gobi 2000 QDL device (N0218, VU936) */ | ||
51 | {USB_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ | ||
52 | {USB_DEVICE(0x05c6, 0x9224)}, /* Sony Gobi 2000 QDL device (N0279, VU730) */ | ||
53 | {USB_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ | ||
54 | {USB_DEVICE(0x05c6, 0x9244)}, /* Samsung Gobi 2000 QDL device (VL176) */ | ||
55 | {USB_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */ | ||
56 | {USB_DEVICE(0x03f0, 0x241d)}, /* HP Gobi 2000 QDL device (VP412) */ | ||
57 | {USB_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */ | ||
58 | {USB_DEVICE(0x05c6, 0x9214)}, /* Acer Gobi 2000 QDL device (VP413) */ | ||
59 | {USB_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */ | ||
60 | {USB_DEVICE(0x05c6, 0x9264)}, /* Asus Gobi 2000 QDL device (VR305) */ | ||
61 | {USB_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */ | ||
62 | {USB_DEVICE(0x05c6, 0x9234)}, /* Top Global Gobi 2000 QDL device (VR306) */ | ||
63 | {USB_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */ | ||
64 | {USB_DEVICE(0x05c6, 0x9274)}, /* iRex Technologies Gobi 2000 QDL device (VR307) */ | ||
65 | {USB_DEVICE(0x05c6, 0x9275)}, /* iRex Technologies Gobi 2000 Modem device (VR307) */ | ||
66 | {USB_DEVICE(0x1199, 0x9000)}, /* Sierra Wireless Gobi 2000 QDL device (VT773) */ | ||
67 | {USB_DEVICE(0x1199, 0x9001)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ | ||
68 | {USB_DEVICE(0x1199, 0x9002)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ | ||
69 | {USB_DEVICE(0x1199, 0x9003)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ | ||
70 | {USB_DEVICE(0x1199, 0x9004)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ | ||
71 | {USB_DEVICE(0x1199, 0x9005)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ | ||
72 | {USB_DEVICE(0x1199, 0x9006)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ | ||
73 | {USB_DEVICE(0x1199, 0x9007)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ | ||
74 | {USB_DEVICE(0x1199, 0x9008)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ | ||
75 | {USB_DEVICE(0x1199, 0x9009)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ | ||
76 | {USB_DEVICE(0x1199, 0x900a)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ | ||
77 | {USB_DEVICE(0x16d8, 0x8001)}, /* CMDTech Gobi 2000 QDL device (VU922) */ | ||
78 | {USB_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */ | ||
50 | { } /* Terminating entry */ | 79 | { } /* Terminating entry */ |
51 | }; | 80 | }; |
52 | MODULE_DEVICE_TABLE(usb, id_table); | 81 | MODULE_DEVICE_TABLE(usb, id_table); |
diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c index 4b463cd140ef..43a0cadd5782 100644 --- a/drivers/usb/serial/safe_serial.c +++ b/drivers/usb/serial/safe_serial.c | |||
@@ -64,8 +64,8 @@ | |||
64 | 64 | ||
65 | #include <linux/kernel.h> | 65 | #include <linux/kernel.h> |
66 | #include <linux/errno.h> | 66 | #include <linux/errno.h> |
67 | #include <linux/gfp.h> | ||
67 | #include <linux/init.h> | 68 | #include <linux/init.h> |
68 | #include <linux/slab.h> | ||
69 | #include <linux/tty.h> | 69 | #include <linux/tty.h> |
70 | #include <linux/tty_driver.h> | 70 | #include <linux/tty_driver.h> |
71 | #include <linux/tty_flip.h> | 71 | #include <linux/tty_flip.h> |
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 34e6f894cba9..ef0bdb08d788 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/jiffies.h> | 26 | #include <linux/jiffies.h> |
27 | #include <linux/errno.h> | 27 | #include <linux/errno.h> |
28 | #include <linux/tty.h> | 28 | #include <linux/tty.h> |
29 | #include <linux/slab.h> | ||
29 | #include <linux/tty_flip.h> | 30 | #include <linux/tty_flip.h> |
30 | #include <linux/module.h> | 31 | #include <linux/module.h> |
31 | #include <linux/usb.h> | 32 | #include <linux/usb.h> |
@@ -229,6 +230,7 @@ static const struct sierra_iface_info direct_ip_interface_blacklist = { | |||
229 | static const struct usb_device_id id_table[] = { | 230 | static const struct usb_device_id id_table[] = { |
230 | { USB_DEVICE(0x0F3D, 0x0112) }, /* Airprime/Sierra PC 5220 */ | 231 | { USB_DEVICE(0x0F3D, 0x0112) }, /* Airprime/Sierra PC 5220 */ |
231 | { USB_DEVICE(0x03F0, 0x1B1D) }, /* HP ev2200 a.k.a MC5720 */ | 232 | { USB_DEVICE(0x03F0, 0x1B1D) }, /* HP ev2200 a.k.a MC5720 */ |
233 | { USB_DEVICE(0x03F0, 0x211D) }, /* HP ev2210 a.k.a MC5725 */ | ||
232 | { USB_DEVICE(0x03F0, 0x1E1D) }, /* HP hs2300 a.k.a MC8775 */ | 234 | { USB_DEVICE(0x03F0, 0x1E1D) }, /* HP hs2300 a.k.a MC8775 */ |
233 | 235 | ||
234 | { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */ | 236 | { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */ |
diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c index 72398888858f..d9457bd4fe10 100644 --- a/drivers/usb/serial/symbolserial.c +++ b/drivers/usb/serial/symbolserial.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/tty.h> | 14 | #include <linux/tty.h> |
15 | #include <linux/slab.h> | ||
15 | #include <linux/tty_driver.h> | 16 | #include <linux/tty_driver.h> |
16 | #include <linux/tty_flip.h> | 17 | #include <linux/tty_flip.h> |
17 | #include <linux/module.h> | 18 | #include <linux/module.h> |
@@ -94,7 +95,7 @@ static void symbol_int_callback(struct urb *urb) | |||
94 | } | 95 | } |
95 | } else { | 96 | } else { |
96 | dev_dbg(&priv->udev->dev, | 97 | dev_dbg(&priv->udev->dev, |
97 | "Improper ammount of data received from the device, " | 98 | "Improper amount of data received from the device, " |
98 | "%d bytes", urb->actual_length); | 99 | "%d bytes", urb->actual_length); |
99 | } | 100 | } |
100 | 101 | ||
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 0afe5c71c17e..e1bfda33f5b9 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
@@ -172,7 +172,7 @@ static unsigned int product_5052_count; | |||
172 | /* the array dimension is the number of default entries plus */ | 172 | /* the array dimension is the number of default entries plus */ |
173 | /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */ | 173 | /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */ |
174 | /* null entry */ | 174 | /* null entry */ |
175 | static struct usb_device_id ti_id_table_3410[10+TI_EXTRA_VID_PID_COUNT+1] = { | 175 | static struct usb_device_id ti_id_table_3410[13+TI_EXTRA_VID_PID_COUNT+1] = { |
176 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, | 176 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, |
177 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, | 177 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, |
178 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, | 178 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, |
@@ -180,6 +180,9 @@ static struct usb_device_id ti_id_table_3410[10+TI_EXTRA_VID_PID_COUNT+1] = { | |||
180 | { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_PRODUCT_ID) }, | 180 | { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_PRODUCT_ID) }, |
181 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) }, | 181 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) }, |
182 | { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) }, | 182 | { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) }, |
183 | { USB_DEVICE(MTS_VENDOR_ID, MTS_MT9234MU_PRODUCT_ID) }, | ||
184 | { USB_DEVICE(MTS_VENDOR_ID, MTS_MT9234ZBA_PRODUCT_ID) }, | ||
185 | { USB_DEVICE(MTS_VENDOR_ID, MTS_MT9234ZBAOLD_PRODUCT_ID) }, | ||
183 | { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, | 186 | { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, |
184 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) }, | 187 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) }, |
185 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) }, | 188 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) }, |
@@ -192,7 +195,7 @@ static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = { | |||
192 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) }, | 195 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) }, |
193 | }; | 196 | }; |
194 | 197 | ||
195 | static struct usb_device_id ti_id_table_combined[14+2*TI_EXTRA_VID_PID_COUNT+1] = { | 198 | static struct usb_device_id ti_id_table_combined[17+2*TI_EXTRA_VID_PID_COUNT+1] = { |
196 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, | 199 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, |
197 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, | 200 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, |
198 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, | 201 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, |
@@ -200,6 +203,9 @@ static struct usb_device_id ti_id_table_combined[14+2*TI_EXTRA_VID_PID_COUNT+1] | |||
200 | { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_PRODUCT_ID) }, | 203 | { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_PRODUCT_ID) }, |
201 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) }, | 204 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) }, |
202 | { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) }, | 205 | { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) }, |
206 | { USB_DEVICE(MTS_VENDOR_ID, MTS_MT9234MU_PRODUCT_ID) }, | ||
207 | { USB_DEVICE(MTS_VENDOR_ID, MTS_MT9234ZBA_PRODUCT_ID) }, | ||
208 | { USB_DEVICE(MTS_VENDOR_ID, MTS_MT9234ZBAOLD_PRODUCT_ID) }, | ||
203 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_BOOT_PRODUCT_ID) }, | 209 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_BOOT_PRODUCT_ID) }, |
204 | { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) }, | 210 | { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) }, |
205 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) }, | 211 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) }, |
@@ -287,6 +293,8 @@ MODULE_FIRMWARE("ti_5052.fw"); | |||
287 | MODULE_FIRMWARE("mts_cdma.fw"); | 293 | MODULE_FIRMWARE("mts_cdma.fw"); |
288 | MODULE_FIRMWARE("mts_gsm.fw"); | 294 | MODULE_FIRMWARE("mts_gsm.fw"); |
289 | MODULE_FIRMWARE("mts_edge.fw"); | 295 | MODULE_FIRMWARE("mts_edge.fw"); |
296 | MODULE_FIRMWARE("mts_mt9234mu.fw"); | ||
297 | MODULE_FIRMWARE("mts_mt9234zba.fw"); | ||
290 | 298 | ||
291 | module_param(debug, bool, S_IRUGO | S_IWUSR); | 299 | module_param(debug, bool, S_IRUGO | S_IWUSR); |
292 | MODULE_PARM_DESC(debug, "Enable debugging, 0=no, 1=yes"); | 300 | MODULE_PARM_DESC(debug, "Enable debugging, 0=no, 1=yes"); |
@@ -1687,6 +1695,7 @@ static int ti_download_firmware(struct ti_device *tdev) | |||
1687 | const struct firmware *fw_p; | 1695 | const struct firmware *fw_p; |
1688 | char buf[32]; | 1696 | char buf[32]; |
1689 | 1697 | ||
1698 | dbg("%s\n", __func__); | ||
1690 | /* try ID specific firmware first, then try generic firmware */ | 1699 | /* try ID specific firmware first, then try generic firmware */ |
1691 | sprintf(buf, "ti_usb-v%04x-p%04x.fw", dev->descriptor.idVendor, | 1700 | sprintf(buf, "ti_usb-v%04x-p%04x.fw", dev->descriptor.idVendor, |
1692 | dev->descriptor.idProduct); | 1701 | dev->descriptor.idProduct); |
@@ -1703,7 +1712,15 @@ static int ti_download_firmware(struct ti_device *tdev) | |||
1703 | case MTS_EDGE_PRODUCT_ID: | 1712 | case MTS_EDGE_PRODUCT_ID: |
1704 | strcpy(buf, "mts_edge.fw"); | 1713 | strcpy(buf, "mts_edge.fw"); |
1705 | break; | 1714 | break; |
1706 | } | 1715 | case MTS_MT9234MU_PRODUCT_ID: |
1716 | strcpy(buf, "mts_mt9234mu.fw"); | ||
1717 | break; | ||
1718 | case MTS_MT9234ZBA_PRODUCT_ID: | ||
1719 | strcpy(buf, "mts_mt9234zba.fw"); | ||
1720 | break; | ||
1721 | case MTS_MT9234ZBAOLD_PRODUCT_ID: | ||
1722 | strcpy(buf, "mts_mt9234zba.fw"); | ||
1723 | break; } | ||
1707 | } | 1724 | } |
1708 | if (buf[0] == '\0') { | 1725 | if (buf[0] == '\0') { |
1709 | if (tdev->td_is_3410) | 1726 | if (tdev->td_is_3410) |
@@ -1718,7 +1735,7 @@ static int ti_download_firmware(struct ti_device *tdev) | |||
1718 | return -ENOENT; | 1735 | return -ENOENT; |
1719 | } | 1736 | } |
1720 | if (fw_p->size > TI_FIRMWARE_BUF_SIZE) { | 1737 | if (fw_p->size > TI_FIRMWARE_BUF_SIZE) { |
1721 | dev_err(&dev->dev, "%s - firmware too large\n", __func__); | 1738 | dev_err(&dev->dev, "%s - firmware too large %zu\n", __func__, fw_p->size); |
1722 | return -ENOENT; | 1739 | return -ENOENT; |
1723 | } | 1740 | } |
1724 | 1741 | ||
@@ -1730,6 +1747,7 @@ static int ti_download_firmware(struct ti_device *tdev) | |||
1730 | status = ti_do_download(dev, pipe, buffer, fw_p->size); | 1747 | status = ti_do_download(dev, pipe, buffer, fw_p->size); |
1731 | kfree(buffer); | 1748 | kfree(buffer); |
1732 | } else { | 1749 | } else { |
1750 | dbg("%s ENOMEM\n", __func__); | ||
1733 | status = -ENOMEM; | 1751 | status = -ENOMEM; |
1734 | } | 1752 | } |
1735 | release_firmware(fw_p); | 1753 | release_firmware(fw_p); |
diff --git a/drivers/usb/serial/ti_usb_3410_5052.h b/drivers/usb/serial/ti_usb_3410_5052.h index f323c6025858..2aac1953993b 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.h +++ b/drivers/usb/serial/ti_usb_3410_5052.h | |||
@@ -45,6 +45,9 @@ | |||
45 | #define MTS_CDMA_PRODUCT_ID 0xF110 | 45 | #define MTS_CDMA_PRODUCT_ID 0xF110 |
46 | #define MTS_GSM_PRODUCT_ID 0xF111 | 46 | #define MTS_GSM_PRODUCT_ID 0xF111 |
47 | #define MTS_EDGE_PRODUCT_ID 0xF112 | 47 | #define MTS_EDGE_PRODUCT_ID 0xF112 |
48 | #define MTS_MT9234MU_PRODUCT_ID 0xF114 | ||
49 | #define MTS_MT9234ZBA_PRODUCT_ID 0xF115 | ||
50 | #define MTS_MT9234ZBAOLD_PRODUCT_ID 0x0319 | ||
48 | 51 | ||
49 | /* Commands */ | 52 | /* Commands */ |
50 | #define TI_GET_VERSION 0x01 | 53 | #define TI_GET_VERSION 0x01 |
diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c index 252cc2d993b2..28026b47344a 100644 --- a/drivers/usb/serial/usb_debug.c +++ b/drivers/usb/serial/usb_debug.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * 2 as published by the Free Software Foundation. | 8 | * 2 as published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/gfp.h> | ||
11 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 13 | #include <linux/init.h> |
13 | #include <linux/tty.h> | 14 | #include <linux/tty.h> |
diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c index 67edc65acb8e..42d0eaed4a01 100644 --- a/drivers/usb/storage/alauda.c +++ b/drivers/usb/storage/alauda.c | |||
@@ -32,6 +32,7 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <linux/module.h> | 34 | #include <linux/module.h> |
35 | #include <linux/slab.h> | ||
35 | 36 | ||
36 | #include <scsi/scsi.h> | 37 | #include <scsi/scsi.h> |
37 | #include <scsi/scsi_cmnd.h> | 38 | #include <scsi/scsi_cmnd.h> |
diff --git a/drivers/usb/storage/karma.c b/drivers/usb/storage/karma.c index 7953d93a7739..ba1b78906880 100644 --- a/drivers/usb/storage/karma.c +++ b/drivers/usb/storage/karma.c | |||
@@ -19,6 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include <linux/slab.h> | ||
22 | 23 | ||
23 | #include <scsi/scsi.h> | 24 | #include <scsi/scsi.h> |
24 | #include <scsi/scsi_cmnd.h> | 25 | #include <scsi/scsi_cmnd.h> |
diff --git a/drivers/usb/storage/option_ms.c b/drivers/usb/storage/option_ms.c index 773a5cd38c5a..89460181d122 100644 --- a/drivers/usb/storage/option_ms.c +++ b/drivers/usb/storage/option_ms.c | |||
@@ -21,6 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/usb.h> | 23 | #include <linux/usb.h> |
24 | #include <linux/slab.h> | ||
24 | 25 | ||
25 | #include "usb.h" | 26 | #include "usb.h" |
26 | #include "transport.h" | 27 | #include "transport.h" |
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 4cc035562cc2..d8d98cfecada 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
@@ -43,7 +43,6 @@ | |||
43 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 43 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
44 | */ | 44 | */ |
45 | 45 | ||
46 | #include <linux/slab.h> | ||
47 | #include <linux/module.h> | 46 | #include <linux/module.h> |
48 | #include <linux/mutex.h> | 47 | #include <linux/mutex.h> |
49 | 48 | ||
diff --git a/drivers/usb/storage/sierra_ms.c b/drivers/usb/storage/sierra_ms.c index 4395c4100ec2..57fc2f532cab 100644 --- a/drivers/usb/storage/sierra_ms.c +++ b/drivers/usb/storage/sierra_ms.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <scsi/scsi_cmnd.h> | 3 | #include <scsi/scsi_cmnd.h> |
4 | #include <scsi/scsi_device.h> | 4 | #include <scsi/scsi_device.h> |
5 | #include <linux/usb.h> | 5 | #include <linux/usb.h> |
6 | #include <linux/slab.h> | ||
6 | 7 | ||
7 | #include "usb.h" | 8 | #include "usb.h" |
8 | #include "transport.h" | 9 | #include "transport.h" |
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index 468038126e5e..f253edec3bb8 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c | |||
@@ -44,8 +44,8 @@ | |||
44 | */ | 44 | */ |
45 | 45 | ||
46 | #include <linux/sched.h> | 46 | #include <linux/sched.h> |
47 | #include <linux/gfp.h> | ||
47 | #include <linux/errno.h> | 48 | #include <linux/errno.h> |
48 | #include <linux/slab.h> | ||
49 | 49 | ||
50 | #include <linux/usb/quirks.h> | 50 | #include <linux/usb/quirks.h> |
51 | 51 | ||
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 98b549b1cab2..ccf1dbbb87ef 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -374,6 +374,15 @@ UNUSUAL_DEV( 0x04ce, 0x0002, 0x0074, 0x0074, | |||
374 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 374 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
375 | US_FL_FIX_INQUIRY), | 375 | US_FL_FIX_INQUIRY), |
376 | 376 | ||
377 | /* Reported by Ondrej Zary <linux@rainbow-software.org> | ||
378 | * The device reports one sector more and breaks when that sector is accessed | ||
379 | */ | ||
380 | UNUSUAL_DEV( 0x04ce, 0x0002, 0x026c, 0x026c, | ||
381 | "ScanLogic", | ||
382 | "SL11R-IDE", | ||
383 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
384 | US_FL_FIX_CAPACITY), | ||
385 | |||
377 | /* Reported by Kriston Fincher <kriston@airmail.net> | 386 | /* Reported by Kriston Fincher <kriston@airmail.net> |
378 | * Patch submitted by Sean Millichamp <sean@bruenor.org> | 387 | * Patch submitted by Sean Millichamp <sean@bruenor.org> |
379 | * This is to support the Panasonic PalmCam PV-SD4090 | 388 | * This is to support the Panasonic PalmCam PV-SD4090 |
@@ -1380,20 +1389,6 @@ UNUSUAL_DEV( 0x0f19, 0x0105, 0x0100, 0x0100, | |||
1380 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 1389 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
1381 | US_FL_IGNORE_RESIDUE ), | 1390 | US_FL_IGNORE_RESIDUE ), |
1382 | 1391 | ||
1383 | /* Jeremy Katz <katzj@redhat.com>: | ||
1384 | * The Blackberry Pearl can run in two modes; a usb-storage only mode | ||
1385 | * and a mode that allows access via mass storage and to its database. | ||
1386 | * The berry_charge module will set the device to dual mode and thus we | ||
1387 | * should ignore its native mode if that module is built | ||
1388 | */ | ||
1389 | #ifdef CONFIG_USB_BERRY_CHARGE | ||
1390 | UNUSUAL_DEV( 0x0fca, 0x0006, 0x0001, 0x0001, | ||
1391 | "RIM", | ||
1392 | "Blackberry Pearl", | ||
1393 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
1394 | US_FL_IGNORE_DEVICE ), | ||
1395 | #endif | ||
1396 | |||
1397 | /* Reported by Michael Stattmann <michael@stattmann.com> */ | 1392 | /* Reported by Michael Stattmann <michael@stattmann.com> */ |
1398 | UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000, | 1393 | UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000, |
1399 | "Sony Ericsson", | 1394 | "Sony Ericsson", |
diff --git a/drivers/usb/wusbcore/cbaf.c b/drivers/usb/wusbcore/cbaf.c index 51a8e0d5789d..c0c5665e60a9 100644 --- a/drivers/usb/wusbcore/cbaf.c +++ b/drivers/usb/wusbcore/cbaf.c | |||
@@ -92,6 +92,7 @@ | |||
92 | #include <linux/interrupt.h> | 92 | #include <linux/interrupt.h> |
93 | #include <linux/delay.h> | 93 | #include <linux/delay.h> |
94 | #include <linux/random.h> | 94 | #include <linux/random.h> |
95 | #include <linux/slab.h> | ||
95 | #include <linux/mutex.h> | 96 | #include <linux/mutex.h> |
96 | #include <linux/uwb.h> | 97 | #include <linux/uwb.h> |
97 | #include <linux/usb/wusb.h> | 98 | #include <linux/usb/wusb.h> |
diff --git a/drivers/usb/wusbcore/crypto.c b/drivers/usb/wusbcore/crypto.c index 9579cf4c38bf..827c87f10cc5 100644 --- a/drivers/usb/wusbcore/crypto.c +++ b/drivers/usb/wusbcore/crypto.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <linux/module.h> | 49 | #include <linux/module.h> |
50 | #include <linux/err.h> | 50 | #include <linux/err.h> |
51 | #include <linux/uwb.h> | 51 | #include <linux/uwb.h> |
52 | #include <linux/slab.h> | ||
52 | #include <linux/usb/wusb.h> | 53 | #include <linux/usb/wusb.h> |
53 | #include <linux/scatterlist.h> | 54 | #include <linux/scatterlist.h> |
54 | 55 | ||
diff --git a/drivers/usb/wusbcore/devconnect.c b/drivers/usb/wusbcore/devconnect.c index 1c918286159c..7ec24e46b34b 100644 --- a/drivers/usb/wusbcore/devconnect.c +++ b/drivers/usb/wusbcore/devconnect.c | |||
@@ -88,6 +88,7 @@ | |||
88 | 88 | ||
89 | #include <linux/jiffies.h> | 89 | #include <linux/jiffies.h> |
90 | #include <linux/ctype.h> | 90 | #include <linux/ctype.h> |
91 | #include <linux/slab.h> | ||
91 | #include <linux/workqueue.h> | 92 | #include <linux/workqueue.h> |
92 | #include "wusbhc.h" | 93 | #include "wusbhc.h" |
93 | 94 | ||
@@ -437,7 +438,7 @@ static void __wusbhc_keep_alive(struct wusbhc *wusbhc) | |||
437 | old_keep_alives = ie->hdr.bLength - sizeof(ie->hdr); | 438 | old_keep_alives = ie->hdr.bLength - sizeof(ie->hdr); |
438 | keep_alives = 0; | 439 | keep_alives = 0; |
439 | for (cnt = 0; | 440 | for (cnt = 0; |
440 | keep_alives <= WUIE_ELT_MAX && cnt < wusbhc->ports_max; | 441 | keep_alives < WUIE_ELT_MAX && cnt < wusbhc->ports_max; |
441 | cnt++) { | 442 | cnt++) { |
442 | unsigned tt = msecs_to_jiffies(wusbhc->trust_timeout); | 443 | unsigned tt = msecs_to_jiffies(wusbhc->trust_timeout); |
443 | 444 | ||
diff --git a/drivers/usb/wusbcore/mmc.c b/drivers/usb/wusbcore/mmc.c index 2d827397e30b..0a57ff0a0b0c 100644 --- a/drivers/usb/wusbcore/mmc.c +++ b/drivers/usb/wusbcore/mmc.c | |||
@@ -37,6 +37,7 @@ | |||
37 | * - add timers that autoremove intervalled IEs? | 37 | * - add timers that autoremove intervalled IEs? |
38 | */ | 38 | */ |
39 | #include <linux/usb/wusb.h> | 39 | #include <linux/usb/wusb.h> |
40 | #include <linux/slab.h> | ||
40 | #include "wusbhc.h" | 41 | #include "wusbhc.h" |
41 | 42 | ||
42 | /* Initialize the MMCIEs handling mechanism */ | 43 | /* Initialize the MMCIEs handling mechanism */ |
diff --git a/drivers/usb/wusbcore/rh.c b/drivers/usb/wusbcore/rh.c index 9fe4246cecb9..a68ad7aa0b59 100644 --- a/drivers/usb/wusbcore/rh.c +++ b/drivers/usb/wusbcore/rh.c | |||
@@ -69,6 +69,7 @@ | |||
69 | * | 69 | * |
70 | * wusbhc_rh_start_port_reset() ??? unimplemented | 70 | * wusbhc_rh_start_port_reset() ??? unimplemented |
71 | */ | 71 | */ |
72 | #include <linux/slab.h> | ||
72 | #include "wusbhc.h" | 73 | #include "wusbhc.h" |
73 | 74 | ||
74 | /* | 75 | /* |
diff --git a/drivers/usb/wusbcore/security.c b/drivers/usb/wusbcore/security.c index edcd2d756037..b60799b811c1 100644 --- a/drivers/usb/wusbcore/security.c +++ b/drivers/usb/wusbcore/security.c | |||
@@ -23,6 +23,7 @@ | |||
23 | * FIXME: docs | 23 | * FIXME: docs |
24 | */ | 24 | */ |
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | #include <linux/slab.h> | ||
26 | #include <linux/usb/ch9.h> | 27 | #include <linux/usb/ch9.h> |
27 | #include <linux/random.h> | 28 | #include <linux/random.h> |
28 | #include "wusbhc.h" | 29 | #include "wusbhc.h" |
diff --git a/drivers/usb/wusbcore/wa-hc.c b/drivers/usb/wusbcore/wa-hc.c index 9d04722415bb..59a748a0e5da 100644 --- a/drivers/usb/wusbcore/wa-hc.c +++ b/drivers/usb/wusbcore/wa-hc.c | |||
@@ -22,6 +22,7 @@ | |||
22 | * | 22 | * |
23 | * FIXME: docs | 23 | * FIXME: docs |
24 | */ | 24 | */ |
25 | #include <linux/slab.h> | ||
25 | #include "wusbhc.h" | 26 | #include "wusbhc.h" |
26 | #include "wa-hc.h" | 27 | #include "wa-hc.h" |
27 | 28 | ||
diff --git a/drivers/usb/wusbcore/wa-nep.c b/drivers/usb/wusbcore/wa-nep.c index 17d2626038be..f67f7f1e6df9 100644 --- a/drivers/usb/wusbcore/wa-nep.c +++ b/drivers/usb/wusbcore/wa-nep.c | |||
@@ -51,6 +51,7 @@ | |||
51 | */ | 51 | */ |
52 | #include <linux/workqueue.h> | 52 | #include <linux/workqueue.h> |
53 | #include <linux/ctype.h> | 53 | #include <linux/ctype.h> |
54 | #include <linux/slab.h> | ||
54 | 55 | ||
55 | #include "wa-hc.h" | 56 | #include "wa-hc.h" |
56 | #include "wusbhc.h" | 57 | #include "wusbhc.h" |
diff --git a/drivers/usb/wusbcore/wa-rpipe.c b/drivers/usb/wusbcore/wa-rpipe.c index 7369655f69cd..c7b1d8108de9 100644 --- a/drivers/usb/wusbcore/wa-rpipe.c +++ b/drivers/usb/wusbcore/wa-rpipe.c | |||
@@ -60,6 +60,7 @@ | |||
60 | #include <linux/init.h> | 60 | #include <linux/init.h> |
61 | #include <asm/atomic.h> | 61 | #include <asm/atomic.h> |
62 | #include <linux/bitmap.h> | 62 | #include <linux/bitmap.h> |
63 | #include <linux/slab.h> | ||
63 | 64 | ||
64 | #include "wusbhc.h" | 65 | #include "wusbhc.h" |
65 | #include "wa-hc.h" | 66 | #include "wa-hc.h" |
diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c index 489b47833e2c..112ef7e26f6b 100644 --- a/drivers/usb/wusbcore/wa-xfer.c +++ b/drivers/usb/wusbcore/wa-xfer.c | |||
@@ -81,6 +81,7 @@ | |||
81 | */ | 81 | */ |
82 | #include <linux/init.h> | 82 | #include <linux/init.h> |
83 | #include <linux/spinlock.h> | 83 | #include <linux/spinlock.h> |
84 | #include <linux/slab.h> | ||
84 | #include <linux/hash.h> | 85 | #include <linux/hash.h> |
85 | 86 | ||
86 | #include "wa-hc.h" | 87 | #include "wa-hc.h" |
diff --git a/drivers/usb/wusbcore/wusbhc.h b/drivers/usb/wusbcore/wusbhc.h index fd2fd4e277e1..759cda55f7c3 100644 --- a/drivers/usb/wusbcore/wusbhc.h +++ b/drivers/usb/wusbcore/wusbhc.h | |||
@@ -198,7 +198,7 @@ struct wusb_port { | |||
198 | * ports) this HC will take. Read-only. | 198 | * ports) this HC will take. Read-only. |
199 | * | 199 | * |
200 | * @port Array of port status for each fake root port. Guaranteed to | 200 | * @port Array of port status for each fake root port. Guaranteed to |
201 | * always be the same lenght during device existence | 201 | * always be the same length during device existence |
202 | * [this allows for some unlocked but referenced reading]. | 202 | * [this allows for some unlocked but referenced reading]. |
203 | * | 203 | * |
204 | * @mmcies_max Max number of Information Elements this HC can send | 204 | * @mmcies_max Max number of Information Elements this HC can send |