diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-01 19:41:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-01 19:41:31 -0400 |
commit | acab460b0f618e1e9663eea8c52ad5edd552ed1d (patch) | |
tree | c139f945e7a05ab3a12ced855453f8f48762d84e /drivers/usb | |
parent | 8e36f79ecf4f8b09c5ee5041cf97f180e847838e (diff) | |
parent | 72c487dfb94d02025fb7437dfe2314d836d5a9ab (diff) |
Merge branch 'for-greg' of master.kernel.org:/pub/scm/linux/kernel/git/balbi/usb into usb-linus
* 'for-greg' of master.kernel.org:/pub/scm/linux/kernel/git/balbi/usb:
usb: musb: fix oops on musb_gadget_pullup
usb: host: ehci-omap: fix .remove and failure handling path of .probe(v1)
usb: gadget: hid: don't STALL when processing a HID Descriptor request
usb: musb: fix Kconfig
usb: musb: tusb6010_omap: fix build failure: error: 'musb' undeclared
usb: gadget: composite: fix bMaxPacketSize for SuperSpeed
usb: gadget: fusb300: remove #if 0 block
usb: gadget: s3c2410_udc: fix unterminated platform_device_id table
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/Kconfig | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/composite.c | 6 | ||||
-rw-r--r-- | drivers/usb/gadget/f_hid.c | 7 | ||||
-rw-r--r-- | drivers/usb/gadget/fusb300_udc.c | 101 | ||||
-rw-r--r-- | drivers/usb/gadget/s3c2410_udc.c | 1 | ||||
-rw-r--r-- | drivers/usb/host/ehci-omap.c | 16 | ||||
-rw-r--r-- | drivers/usb/musb/Kconfig | 3 | ||||
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 5 | ||||
-rw-r--r-- | drivers/usb/musb/tusb6010_omap.c | 2 |
9 files changed, 35 insertions, 108 deletions
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 44b6b40aafb4..5a084b9cfa3c 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig | |||
@@ -310,7 +310,7 @@ config USB_PXA_U2O | |||
310 | # musb builds in ../musb along with host support | 310 | # musb builds in ../musb along with host support |
311 | config USB_GADGET_MUSB_HDRC | 311 | config USB_GADGET_MUSB_HDRC |
312 | tristate "Inventra HDRC USB Peripheral (TI, ADI, ...)" | 312 | tristate "Inventra HDRC USB Peripheral (TI, ADI, ...)" |
313 | depends on USB_MUSB_HDRC && (USB_MUSB_PERIPHERAL || USB_MUSB_OTG) | 313 | depends on USB_MUSB_HDRC |
314 | select USB_GADGET_DUALSPEED | 314 | select USB_GADGET_DUALSPEED |
315 | help | 315 | help |
316 | This OTG-capable silicon IP is used in dual designs including | 316 | This OTG-capable silicon IP is used in dual designs including |
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 5ef87794fd32..aef47414f5d5 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c | |||
@@ -1079,10 +1079,12 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) | |||
1079 | cdev->desc.bMaxPacketSize0 = | 1079 | cdev->desc.bMaxPacketSize0 = |
1080 | cdev->gadget->ep0->maxpacket; | 1080 | cdev->gadget->ep0->maxpacket; |
1081 | if (gadget_is_superspeed(gadget)) { | 1081 | if (gadget_is_superspeed(gadget)) { |
1082 | if (gadget->speed >= USB_SPEED_SUPER) | 1082 | if (gadget->speed >= USB_SPEED_SUPER) { |
1083 | cdev->desc.bcdUSB = cpu_to_le16(0x0300); | 1083 | cdev->desc.bcdUSB = cpu_to_le16(0x0300); |
1084 | else | 1084 | cdev->desc.bMaxPacketSize0 = 9; |
1085 | } else { | ||
1085 | cdev->desc.bcdUSB = cpu_to_le16(0x0210); | 1086 | cdev->desc.bcdUSB = cpu_to_le16(0x0210); |
1087 | } | ||
1086 | } | 1088 | } |
1087 | 1089 | ||
1088 | value = min(w_length, (u16) sizeof cdev->desc); | 1090 | value = min(w_length, (u16) sizeof cdev->desc); |
diff --git a/drivers/usb/gadget/f_hid.c b/drivers/usb/gadget/f_hid.c index 403a48bcf560..83a266bdb40e 100644 --- a/drivers/usb/gadget/f_hid.c +++ b/drivers/usb/gadget/f_hid.c | |||
@@ -367,6 +367,13 @@ static int hidg_setup(struct usb_function *f, | |||
367 | case ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8 | 367 | case ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8 |
368 | | USB_REQ_GET_DESCRIPTOR): | 368 | | USB_REQ_GET_DESCRIPTOR): |
369 | switch (value >> 8) { | 369 | switch (value >> 8) { |
370 | case HID_DT_HID: | ||
371 | VDBG(cdev, "USB_REQ_GET_DESCRIPTOR: HID\n"); | ||
372 | length = min_t(unsigned short, length, | ||
373 | hidg_desc.bLength); | ||
374 | memcpy(req->buf, &hidg_desc, length); | ||
375 | goto respond; | ||
376 | break; | ||
370 | case HID_DT_REPORT: | 377 | case HID_DT_REPORT: |
371 | VDBG(cdev, "USB_REQ_GET_DESCRIPTOR: REPORT\n"); | 378 | VDBG(cdev, "USB_REQ_GET_DESCRIPTOR: REPORT\n"); |
372 | length = min_t(unsigned short, length, | 379 | length = min_t(unsigned short, length, |
diff --git a/drivers/usb/gadget/fusb300_udc.c b/drivers/usb/gadget/fusb300_udc.c index 24a924330c81..4ec888f90002 100644 --- a/drivers/usb/gadget/fusb300_udc.c +++ b/drivers/usb/gadget/fusb300_udc.c | |||
@@ -609,107 +609,6 @@ void fusb300_rdcxf(struct fusb300 *fusb300, | |||
609 | } | 609 | } |
610 | } | 610 | } |
611 | 611 | ||
612 | #if 0 | ||
613 | static void fusb300_dbg_fifo(struct fusb300_ep *ep, | ||
614 | u8 entry, u16 length) | ||
615 | { | ||
616 | u32 reg; | ||
617 | u32 i = 0; | ||
618 | u32 j = 0; | ||
619 | |||
620 | reg = ioread32(ep->fusb300->reg + FUSB300_OFFSET_GTM); | ||
621 | reg &= ~(FUSB300_GTM_TST_EP_ENTRY(0xF) | | ||
622 | FUSB300_GTM_TST_EP_NUM(0xF) | FUSB300_GTM_TST_FIFO_DEG); | ||
623 | reg |= (FUSB300_GTM_TST_EP_ENTRY(entry) | | ||
624 | FUSB300_GTM_TST_EP_NUM(ep->epnum) | FUSB300_GTM_TST_FIFO_DEG); | ||
625 | iowrite32(reg, ep->fusb300->reg + FUSB300_OFFSET_GTM); | ||
626 | |||
627 | for (i = 0; i < (length >> 2); i++) { | ||
628 | if (i * 4 == 1024) | ||
629 | break; | ||
630 | reg = ioread32(ep->fusb300->reg + | ||
631 | FUSB300_OFFSET_BUFDBG_START + i * 4); | ||
632 | printk(KERN_DEBUG" 0x%-8x", reg); | ||
633 | j++; | ||
634 | if ((j % 4) == 0) | ||
635 | printk(KERN_DEBUG "\n"); | ||
636 | } | ||
637 | |||
638 | if (length % 4) { | ||
639 | reg = ioread32(ep->fusb300->reg + | ||
640 | FUSB300_OFFSET_BUFDBG_START + i * 4); | ||
641 | printk(KERN_DEBUG " 0x%x\n", reg); | ||
642 | } | ||
643 | |||
644 | if ((j % 4) != 0) | ||
645 | printk(KERN_DEBUG "\n"); | ||
646 | |||
647 | fusb300_disable_bit(ep->fusb300, FUSB300_OFFSET_GTM, | ||
648 | FUSB300_GTM_TST_FIFO_DEG); | ||
649 | } | ||
650 | |||
651 | static void fusb300_cmp_dbg_fifo(struct fusb300_ep *ep, | ||
652 | u8 entry, u16 length, u8 *golden) | ||
653 | { | ||
654 | u32 reg; | ||
655 | u32 i = 0; | ||
656 | u32 golden_value; | ||
657 | u8 *tmp; | ||
658 | |||
659 | tmp = golden; | ||
660 | |||
661 | printk(KERN_DEBUG "fusb300_cmp_dbg_fifo (entry %d) : start\n", entry); | ||
662 | |||
663 | reg = ioread32(ep->fusb300->reg + FUSB300_OFFSET_GTM); | ||
664 | reg &= ~(FUSB300_GTM_TST_EP_ENTRY(0xF) | | ||
665 | FUSB300_GTM_TST_EP_NUM(0xF) | FUSB300_GTM_TST_FIFO_DEG); | ||
666 | reg |= (FUSB300_GTM_TST_EP_ENTRY(entry) | | ||
667 | FUSB300_GTM_TST_EP_NUM(ep->epnum) | FUSB300_GTM_TST_FIFO_DEG); | ||
668 | iowrite32(reg, ep->fusb300->reg + FUSB300_OFFSET_GTM); | ||
669 | |||
670 | for (i = 0; i < (length >> 2); i++) { | ||
671 | if (i * 4 == 1024) | ||
672 | break; | ||
673 | golden_value = *tmp | *(tmp + 1) << 8 | | ||
674 | *(tmp + 2) << 16 | *(tmp + 3) << 24; | ||
675 | |||
676 | reg = ioread32(ep->fusb300->reg + | ||
677 | FUSB300_OFFSET_BUFDBG_START + i*4); | ||
678 | |||
679 | if (reg != golden_value) { | ||
680 | printk(KERN_DEBUG "0x%x : ", (u32)(ep->fusb300->reg + | ||
681 | FUSB300_OFFSET_BUFDBG_START + i*4)); | ||
682 | printk(KERN_DEBUG " golden = 0x%x, reg = 0x%x\n", | ||
683 | golden_value, reg); | ||
684 | } | ||
685 | tmp += 4; | ||
686 | } | ||
687 | |||
688 | switch (length % 4) { | ||
689 | case 1: | ||
690 | golden_value = *tmp; | ||
691 | case 2: | ||
692 | golden_value = *tmp | *(tmp + 1) << 8; | ||
693 | case 3: | ||
694 | golden_value = *tmp | *(tmp + 1) << 8 | *(tmp + 2) << 16; | ||
695 | default: | ||
696 | break; | ||
697 | |||
698 | reg = ioread32(ep->fusb300->reg + FUSB300_OFFSET_BUFDBG_START + i*4); | ||
699 | if (reg != golden_value) { | ||
700 | printk(KERN_DEBUG "0x%x:", (u32)(ep->fusb300->reg + | ||
701 | FUSB300_OFFSET_BUFDBG_START + i*4)); | ||
702 | printk(KERN_DEBUG " golden = 0x%x, reg = 0x%x\n", | ||
703 | golden_value, reg); | ||
704 | } | ||
705 | } | ||
706 | |||
707 | printk(KERN_DEBUG "fusb300_cmp_dbg_fifo : end\n"); | ||
708 | fusb300_disable_bit(ep->fusb300, FUSB300_OFFSET_GTM, | ||
709 | FUSB300_GTM_TST_FIFO_DEG); | ||
710 | } | ||
711 | #endif | ||
712 | |||
713 | static void fusb300_rdfifo(struct fusb300_ep *ep, | 612 | static void fusb300_rdfifo(struct fusb300_ep *ep, |
714 | struct fusb300_request *req, | 613 | struct fusb300_request *req, |
715 | u32 length) | 614 | u32 length) |
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index 85c1b0d66293..8d31848aab09 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c | |||
@@ -2060,6 +2060,7 @@ static int s3c2410_udc_resume(struct platform_device *pdev) | |||
2060 | static const struct platform_device_id s3c_udc_ids[] = { | 2060 | static const struct platform_device_id s3c_udc_ids[] = { |
2061 | { "s3c2410-usbgadget", }, | 2061 | { "s3c2410-usbgadget", }, |
2062 | { "s3c2440-usbgadget", }, | 2062 | { "s3c2440-usbgadget", }, |
2063 | { } | ||
2063 | }; | 2064 | }; |
2064 | MODULE_DEVICE_TABLE(platform, s3c_udc_ids); | 2065 | MODULE_DEVICE_TABLE(platform, s3c_udc_ids); |
2065 | 2066 | ||
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 55a57c23dd0f..45240321ca09 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -98,6 +98,18 @@ static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port) | |||
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | static void disable_put_regulator( | ||
102 | struct ehci_hcd_omap_platform_data *pdata) | ||
103 | { | ||
104 | int i; | ||
105 | |||
106 | for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) { | ||
107 | if (pdata->regulator[i]) { | ||
108 | regulator_disable(pdata->regulator[i]); | ||
109 | regulator_put(pdata->regulator[i]); | ||
110 | } | ||
111 | } | ||
112 | } | ||
101 | 113 | ||
102 | /* configure so an HC device and id are always provided */ | 114 | /* configure so an HC device and id are always provided */ |
103 | /* always called with process context; sleeping is OK */ | 115 | /* always called with process context; sleeping is OK */ |
@@ -231,9 +243,11 @@ err_add_hcd: | |||
231 | omap_usbhs_disable(dev); | 243 | omap_usbhs_disable(dev); |
232 | 244 | ||
233 | err_enable: | 245 | err_enable: |
246 | disable_put_regulator(pdata); | ||
234 | usb_put_hcd(hcd); | 247 | usb_put_hcd(hcd); |
235 | 248 | ||
236 | err_io: | 249 | err_io: |
250 | iounmap(regs); | ||
237 | return ret; | 251 | return ret; |
238 | } | 252 | } |
239 | 253 | ||
@@ -253,6 +267,8 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) | |||
253 | 267 | ||
254 | usb_remove_hcd(hcd); | 268 | usb_remove_hcd(hcd); |
255 | omap_usbhs_disable(dev); | 269 | omap_usbhs_disable(dev); |
270 | disable_put_regulator(dev->platform_data); | ||
271 | iounmap(hcd->regs); | ||
256 | usb_put_hcd(hcd); | 272 | usb_put_hcd(hcd); |
257 | return 0; | 273 | return 0; |
258 | } | 274 | } |
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig index 6192b45959f4..fc34b8b11910 100644 --- a/drivers/usb/musb/Kconfig +++ b/drivers/usb/musb/Kconfig | |||
@@ -3,9 +3,6 @@ | |||
3 | # for silicon based on Mentor Graphics INVENTRA designs | 3 | # for silicon based on Mentor Graphics INVENTRA designs |
4 | # | 4 | # |
5 | 5 | ||
6 | comment "Enable Host or Gadget support to see Inventra options" | ||
7 | depends on !USB && USB_GADGET=n | ||
8 | |||
9 | # (M)HDRC = (Multipoint) Highspeed Dual-Role Controller | 6 | # (M)HDRC = (Multipoint) Highspeed Dual-Role Controller |
10 | config USB_MUSB_HDRC | 7 | config USB_MUSB_HDRC |
11 | depends on USB && USB_GADGET | 8 | depends on USB && USB_GADGET |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index b67a062f556b..8c41a2e6ea77 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -1698,6 +1698,8 @@ static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on) | |||
1698 | 1698 | ||
1699 | is_on = !!is_on; | 1699 | is_on = !!is_on; |
1700 | 1700 | ||
1701 | pm_runtime_get_sync(musb->controller); | ||
1702 | |||
1701 | /* NOTE: this assumes we are sensing vbus; we'd rather | 1703 | /* NOTE: this assumes we are sensing vbus; we'd rather |
1702 | * not pullup unless the B-session is active. | 1704 | * not pullup unless the B-session is active. |
1703 | */ | 1705 | */ |
@@ -1707,6 +1709,9 @@ static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on) | |||
1707 | musb_pullup(musb, is_on); | 1709 | musb_pullup(musb, is_on); |
1708 | } | 1710 | } |
1709 | spin_unlock_irqrestore(&musb->lock, flags); | 1711 | spin_unlock_irqrestore(&musb->lock, flags); |
1712 | |||
1713 | pm_runtime_put(musb->controller); | ||
1714 | |||
1710 | return 0; | 1715 | return 0; |
1711 | } | 1716 | } |
1712 | 1717 | ||
diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c index c784e6c03aac..07c8a73dfe41 100644 --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c | |||
@@ -89,7 +89,7 @@ static inline int tusb_omap_use_shared_dmareq(struct tusb_omap_dma_ch *chdat) | |||
89 | u32 reg = musb_readl(chdat->tbase, TUSB_DMA_EP_MAP); | 89 | u32 reg = musb_readl(chdat->tbase, TUSB_DMA_EP_MAP); |
90 | 90 | ||
91 | if (reg != 0) { | 91 | if (reg != 0) { |
92 | dev_dbg(musb->controller, "ep%i dmareq0 is busy for ep%i\n", | 92 | dev_dbg(chdat->musb->controller, "ep%i dmareq0 is busy for ep%i\n", |
93 | chdat->epnum, reg & 0xf); | 93 | chdat->epnum, reg & 0xf); |
94 | return -EAGAIN; | 94 | return -EAGAIN; |
95 | } | 95 | } |