diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-16 23:42:46 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-16 23:42:46 -0400 |
commit | 2bcb132c693566bcb8208cc7ce66b72a4f852ecf (patch) | |
tree | 6fc4f05ce18140d86aa78a10380a610734aeaef9 /drivers/usb/gadget | |
parent | 67e6da702753dac8f0540209dded80a0c4e60d81 (diff) | |
parent | 5698bd757d55b1bb87edd1a9744ab09c142abfc2 (diff) |
Merge 3.6-rc6 into usb-next
This resolves the merge problems with:
drivers/usb/dwc3/gadget.c
drivers/usb/musb/tusb6010.c
that had been seen in linux-next.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/at91_udc.c | 6 | ||||
-rw-r--r-- | drivers/usb/gadget/dummy_hcd.c | 41 | ||||
-rw-r--r-- | drivers/usb/gadget/f_fs.c | 4 | ||||
-rw-r--r-- | drivers/usb/gadget/u_serial.c | 4 |
4 files changed, 46 insertions, 9 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index af931282843d..89d90b5fb787 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
@@ -475,8 +475,7 @@ static int at91_ep_enable(struct usb_ep *_ep, | |||
475 | unsigned long flags; | 475 | unsigned long flags; |
476 | 476 | ||
477 | if (!_ep || !ep | 477 | if (!_ep || !ep |
478 | || !desc || ep->ep.desc | 478 | || !desc || _ep->name == ep0name |
479 | || _ep->name == ep0name | ||
480 | || desc->bDescriptorType != USB_DT_ENDPOINT | 479 | || desc->bDescriptorType != USB_DT_ENDPOINT |
481 | || (maxpacket = usb_endpoint_maxp(desc)) == 0 | 480 | || (maxpacket = usb_endpoint_maxp(desc)) == 0 |
482 | || maxpacket > ep->maxpacket) { | 481 | || maxpacket > ep->maxpacket) { |
@@ -531,7 +530,6 @@ ok: | |||
531 | tmp |= AT91_UDP_EPEDS; | 530 | tmp |= AT91_UDP_EPEDS; |
532 | __raw_writel(tmp, ep->creg); | 531 | __raw_writel(tmp, ep->creg); |
533 | 532 | ||
534 | ep->ep.desc = desc; | ||
535 | ep->ep.maxpacket = maxpacket; | 533 | ep->ep.maxpacket = maxpacket; |
536 | 534 | ||
537 | /* | 535 | /* |
@@ -1636,7 +1634,6 @@ static int at91_start(struct usb_gadget *gadget, | |||
1636 | udc->driver = driver; | 1634 | udc->driver = driver; |
1637 | udc->gadget.dev.driver = &driver->driver; | 1635 | udc->gadget.dev.driver = &driver->driver; |
1638 | udc->gadget.dev.of_node = udc->pdev->dev.of_node; | 1636 | udc->gadget.dev.of_node = udc->pdev->dev.of_node; |
1639 | dev_set_drvdata(&udc->gadget.dev, &driver->driver); | ||
1640 | udc->enabled = 1; | 1637 | udc->enabled = 1; |
1641 | udc->selfpowered = 1; | 1638 | udc->selfpowered = 1; |
1642 | 1639 | ||
@@ -1657,7 +1654,6 @@ static int at91_stop(struct usb_gadget *gadget, | |||
1657 | spin_unlock_irqrestore(&udc->lock, flags); | 1654 | spin_unlock_irqrestore(&udc->lock, flags); |
1658 | 1655 | ||
1659 | udc->gadget.dev.driver = NULL; | 1656 | udc->gadget.dev.driver = NULL; |
1660 | dev_set_drvdata(&udc->gadget.dev, NULL); | ||
1661 | udc->driver = NULL; | 1657 | udc->driver = NULL; |
1662 | 1658 | ||
1663 | DBG("unbound from %s\n", driver->driver.name); | 1659 | DBG("unbound from %s\n", driver->driver.name); |
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index 91916f693ff7..0f7541be28f3 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c | |||
@@ -1918,6 +1918,27 @@ done: | |||
1918 | return retval; | 1918 | return retval; |
1919 | } | 1919 | } |
1920 | 1920 | ||
1921 | /* usb 3.0 root hub device descriptor */ | ||
1922 | struct { | ||
1923 | struct usb_bos_descriptor bos; | ||
1924 | struct usb_ss_cap_descriptor ss_cap; | ||
1925 | } __packed usb3_bos_desc = { | ||
1926 | |||
1927 | .bos = { | ||
1928 | .bLength = USB_DT_BOS_SIZE, | ||
1929 | .bDescriptorType = USB_DT_BOS, | ||
1930 | .wTotalLength = cpu_to_le16(sizeof(usb3_bos_desc)), | ||
1931 | .bNumDeviceCaps = 1, | ||
1932 | }, | ||
1933 | .ss_cap = { | ||
1934 | .bLength = USB_DT_USB_SS_CAP_SIZE, | ||
1935 | .bDescriptorType = USB_DT_DEVICE_CAPABILITY, | ||
1936 | .bDevCapabilityType = USB_SS_CAP_TYPE, | ||
1937 | .wSpeedSupported = cpu_to_le16(USB_5GBPS_OPERATION), | ||
1938 | .bFunctionalitySupport = ilog2(USB_5GBPS_OPERATION), | ||
1939 | }, | ||
1940 | }; | ||
1941 | |||
1921 | static inline void | 1942 | static inline void |
1922 | ss_hub_descriptor(struct usb_hub_descriptor *desc) | 1943 | ss_hub_descriptor(struct usb_hub_descriptor *desc) |
1923 | { | 1944 | { |
@@ -2008,6 +2029,18 @@ static int dummy_hub_control( | |||
2008 | else | 2029 | else |
2009 | hub_descriptor((struct usb_hub_descriptor *) buf); | 2030 | hub_descriptor((struct usb_hub_descriptor *) buf); |
2010 | break; | 2031 | break; |
2032 | |||
2033 | case DeviceRequest | USB_REQ_GET_DESCRIPTOR: | ||
2034 | if (hcd->speed != HCD_USB3) | ||
2035 | goto error; | ||
2036 | |||
2037 | if ((wValue >> 8) != USB_DT_BOS) | ||
2038 | goto error; | ||
2039 | |||
2040 | memcpy(buf, &usb3_bos_desc, sizeof(usb3_bos_desc)); | ||
2041 | retval = sizeof(usb3_bos_desc); | ||
2042 | break; | ||
2043 | |||
2011 | case GetHubStatus: | 2044 | case GetHubStatus: |
2012 | *(__le32 *) buf = cpu_to_le32(0); | 2045 | *(__le32 *) buf = cpu_to_le32(0); |
2013 | break; | 2046 | break; |
@@ -2505,10 +2538,8 @@ static int dummy_hcd_probe(struct platform_device *pdev) | |||
2505 | hs_hcd->has_tt = 1; | 2538 | hs_hcd->has_tt = 1; |
2506 | 2539 | ||
2507 | retval = usb_add_hcd(hs_hcd, 0, 0); | 2540 | retval = usb_add_hcd(hs_hcd, 0, 0); |
2508 | if (retval != 0) { | 2541 | if (retval) |
2509 | usb_put_hcd(hs_hcd); | 2542 | goto put_usb2_hcd; |
2510 | return retval; | ||
2511 | } | ||
2512 | 2543 | ||
2513 | if (mod_data.is_super_speed) { | 2544 | if (mod_data.is_super_speed) { |
2514 | ss_hcd = usb_create_shared_hcd(&dummy_hcd, &pdev->dev, | 2545 | ss_hcd = usb_create_shared_hcd(&dummy_hcd, &pdev->dev, |
@@ -2527,6 +2558,8 @@ static int dummy_hcd_probe(struct platform_device *pdev) | |||
2527 | put_usb3_hcd: | 2558 | put_usb3_hcd: |
2528 | usb_put_hcd(ss_hcd); | 2559 | usb_put_hcd(ss_hcd); |
2529 | dealloc_usb2_hcd: | 2560 | dealloc_usb2_hcd: |
2561 | usb_remove_hcd(hs_hcd); | ||
2562 | put_usb2_hcd: | ||
2530 | usb_put_hcd(hs_hcd); | 2563 | usb_put_hcd(hs_hcd); |
2531 | the_controller.hs_hcd = the_controller.ss_hcd = NULL; | 2564 | the_controller.hs_hcd = the_controller.ss_hcd = NULL; |
2532 | return retval; | 2565 | return retval; |
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index 8adc79d1b402..829aba75a6df 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c | |||
@@ -34,11 +34,15 @@ | |||
34 | /* Debugging ****************************************************************/ | 34 | /* Debugging ****************************************************************/ |
35 | 35 | ||
36 | #ifdef VERBOSE_DEBUG | 36 | #ifdef VERBOSE_DEBUG |
37 | #ifndef pr_vdebug | ||
37 | # define pr_vdebug pr_debug | 38 | # define pr_vdebug pr_debug |
39 | #endif /* pr_vdebug */ | ||
38 | # define ffs_dump_mem(prefix, ptr, len) \ | 40 | # define ffs_dump_mem(prefix, ptr, len) \ |
39 | print_hex_dump_bytes(pr_fmt(prefix ": "), DUMP_PREFIX_NONE, ptr, len) | 41 | print_hex_dump_bytes(pr_fmt(prefix ": "), DUMP_PREFIX_NONE, ptr, len) |
40 | #else | 42 | #else |
43 | #ifndef pr_vdebug | ||
41 | # define pr_vdebug(...) do { } while (0) | 44 | # define pr_vdebug(...) do { } while (0) |
45 | #endif /* pr_vdebug */ | ||
42 | # define ffs_dump_mem(prefix, ptr, len) do { } while (0) | 46 | # define ffs_dump_mem(prefix, ptr, len) do { } while (0) |
43 | #endif /* VERBOSE_DEBUG */ | 47 | #endif /* VERBOSE_DEBUG */ |
44 | 48 | ||
diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c index 5b3f5fffea92..da6d479ff9a6 100644 --- a/drivers/usb/gadget/u_serial.c +++ b/drivers/usb/gadget/u_serial.c | |||
@@ -132,11 +132,15 @@ static unsigned n_ports; | |||
132 | 132 | ||
133 | 133 | ||
134 | #ifdef VERBOSE_DEBUG | 134 | #ifdef VERBOSE_DEBUG |
135 | #ifndef pr_vdebug | ||
135 | #define pr_vdebug(fmt, arg...) \ | 136 | #define pr_vdebug(fmt, arg...) \ |
136 | pr_debug(fmt, ##arg) | 137 | pr_debug(fmt, ##arg) |
138 | #endif /* pr_vdebug */ | ||
137 | #else | 139 | #else |
140 | #ifndef pr_vdebig | ||
138 | #define pr_vdebug(fmt, arg...) \ | 141 | #define pr_vdebug(fmt, arg...) \ |
139 | ({ if (0) pr_debug(fmt, ##arg); }) | 142 | ({ if (0) pr_debug(fmt, ##arg); }) |
143 | #endif /* pr_vdebug */ | ||
140 | #endif | 144 | #endif |
141 | 145 | ||
142 | /*-------------------------------------------------------------------------*/ | 146 | /*-------------------------------------------------------------------------*/ |