diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-05 18:18:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-05 18:18:00 -0400 |
commit | 64dc9e2e7320f079b97c46b106133b58b8e18d40 (patch) | |
tree | ab010dc1337d44e29c2b32b7f11788620a91fe4f /drivers/usb/gadget/net2280.c | |
parent | 01a60e76b6392547ad3dca3ac05b9c886fa5da45 (diff) | |
parent | 9b192de60b5a584ee4ed967fb6758773c75e4643 (diff) |
Merge tag 'usb-for-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
Felipe writes:
usb: patches for v3.10 merge window
Here is the big Gadget & PHY pull request. Many of us have
been really busy lately getting multiple drivers to a better
position.
Since this pull request is so large, I will divide it in sections
so it's easier to grasp what's included.
- cleanups:
. UDC drivers no longer touch gadget->dev, that's now udc-core
responsibility
. Many more UDC drivers converted to usb_gadget_map/unmap_request()
. UDC drivers no longer initialize DMA-related fields from gadget's
device structure
. UDC drivers don't touch gadget.dev.driver directly
. UDC drivers don't assign gadget.dev.release directly
. Removal of some unused DMA_ADDR_INVALID
. Introduction of CONFIG_USB_PHY
. All phy drivers have been moved to drivers/usb/phy and renamed to
a common naming scheme
. Fix PHY layer so it never returns a NULL pointer, also fix all
callers to avoid using IS_ERR_OR_NULL()
. Sparse fixes all over the place
. drivers/usb/otg/ has been deleted
. Marvel drivers (mv_udc, ehci-mv, mv_otg and mv_u3d) improved clock
usage
- new features:
. UDC core now provides a generic way for tracking and reporting
UDC's state (not attached, resuming, suspended, addressed,
default, etc)
. twl4030-usb learned that it shouldn't be enabled during init
. Full DT support for DWC3 has been implemented
. ab8500-usb learned about pinctrl framework
. nop PHY learned about DeviceTree and regulators
. DWC3 learned about suspend/resume
. DWC3 can now be compiled in host-only and gadget-only (as well as
DRD) configurations
. UVC now enables streaming endpoint based on negotiated speed
. isp1301 now implements the PHY API properly
. configfs-based interface for gadget drivers which will lead to
the removal of all code which just combines functions together
to build functional gadget drivers.
. f_serial and f_obex were converted to new configfs interface while
maintaining old interface around.
- non-critical fixes:
. UVC gadget driver got fixes for Endpoint usage and stream calculation
. ab8500-usb fixed unbalanced clock and regulator API usage
. twl4030-usb got a fix for when OMAP3 is booted with cable connected
. fusb300_udc got a fix for DMA usage
. UVC got fixes for two assertions of the USB Video Class Compliance
specification revision 1.1
. build warning issues caused by recent addition of __must_check to
regulator API
These are all changes which deserve a mention, all other changes are related
to these one or minor spelling fixes and other similar tasks.
Signed-of-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/net2280.c')
-rw-r--r-- | drivers/usb/gadget/net2280.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c index 3bd0f992fb49..fbd006ab31d3 100644 --- a/drivers/usb/gadget/net2280.c +++ b/drivers/usb/gadget/net2280.c | |||
@@ -65,7 +65,6 @@ | |||
65 | #define DRIVER_DESC "PLX NET228x USB Peripheral Controller" | 65 | #define DRIVER_DESC "PLX NET228x USB Peripheral Controller" |
66 | #define DRIVER_VERSION "2005 Sept 27" | 66 | #define DRIVER_VERSION "2005 Sept 27" |
67 | 67 | ||
68 | #define DMA_ADDR_INVALID (~(dma_addr_t)0) | ||
69 | #define EP_DONTUSE 13 /* nonzero */ | 68 | #define EP_DONTUSE 13 /* nonzero */ |
70 | 69 | ||
71 | #define USE_RDK_LEDS /* GPIO pins control three LEDs */ | 70 | #define USE_RDK_LEDS /* GPIO pins control three LEDs */ |
@@ -406,7 +405,6 @@ net2280_alloc_request (struct usb_ep *_ep, gfp_t gfp_flags) | |||
406 | if (!req) | 405 | if (!req) |
407 | return NULL; | 406 | return NULL; |
408 | 407 | ||
409 | req->req.dma = DMA_ADDR_INVALID; | ||
410 | INIT_LIST_HEAD (&req->queue); | 408 | INIT_LIST_HEAD (&req->queue); |
411 | 409 | ||
412 | /* this dma descriptor may be swapped with the previous dummy */ | 410 | /* this dma descriptor may be swapped with the previous dummy */ |
@@ -420,7 +418,6 @@ net2280_alloc_request (struct usb_ep *_ep, gfp_t gfp_flags) | |||
420 | return NULL; | 418 | return NULL; |
421 | } | 419 | } |
422 | td->dmacount = 0; /* not VALID */ | 420 | td->dmacount = 0; /* not VALID */ |
423 | td->dmaaddr = cpu_to_le32 (DMA_ADDR_INVALID); | ||
424 | td->dmadesc = td->dmaaddr; | 421 | td->dmadesc = td->dmaaddr; |
425 | req->td = td; | 422 | req->td = td; |
426 | } | 423 | } |
@@ -1896,7 +1893,6 @@ static int net2280_start(struct usb_gadget *_gadget, | |||
1896 | dev->softconnect = 1; | 1893 | dev->softconnect = 1; |
1897 | driver->driver.bus = NULL; | 1894 | driver->driver.bus = NULL; |
1898 | dev->driver = driver; | 1895 | dev->driver = driver; |
1899 | dev->gadget.dev.driver = &driver->driver; | ||
1900 | 1896 | ||
1901 | retval = device_create_file (&dev->pdev->dev, &dev_attr_function); | 1897 | retval = device_create_file (&dev->pdev->dev, &dev_attr_function); |
1902 | if (retval) goto err_unbind; | 1898 | if (retval) goto err_unbind; |
@@ -1924,7 +1920,6 @@ static int net2280_start(struct usb_gadget *_gadget, | |||
1924 | err_func: | 1920 | err_func: |
1925 | device_remove_file (&dev->pdev->dev, &dev_attr_function); | 1921 | device_remove_file (&dev->pdev->dev, &dev_attr_function); |
1926 | err_unbind: | 1922 | err_unbind: |
1927 | dev->gadget.dev.driver = NULL; | ||
1928 | dev->driver = NULL; | 1923 | dev->driver = NULL; |
1929 | return retval; | 1924 | return retval; |
1930 | } | 1925 | } |
@@ -1967,7 +1962,6 @@ static int net2280_stop(struct usb_gadget *_gadget, | |||
1967 | stop_activity (dev, driver); | 1962 | stop_activity (dev, driver); |
1968 | spin_unlock_irqrestore (&dev->lock, flags); | 1963 | spin_unlock_irqrestore (&dev->lock, flags); |
1969 | 1964 | ||
1970 | dev->gadget.dev.driver = NULL; | ||
1971 | dev->driver = NULL; | 1965 | dev->driver = NULL; |
1972 | 1966 | ||
1973 | net2280_led_active (dev, 0); | 1967 | net2280_led_active (dev, 0); |
@@ -2072,7 +2066,7 @@ static void handle_ep_small (struct net2280_ep *ep) | |||
2072 | return; | 2066 | return; |
2073 | 2067 | ||
2074 | /* manual DMA queue advance after short OUT */ | 2068 | /* manual DMA queue advance after short OUT */ |
2075 | if (likely (ep->dma != 0)) { | 2069 | if (likely (ep->dma)) { |
2076 | if (t & (1 << SHORT_PACKET_TRANSFERRED_INTERRUPT)) { | 2070 | if (t & (1 << SHORT_PACKET_TRANSFERRED_INTERRUPT)) { |
2077 | u32 count; | 2071 | u32 count; |
2078 | int stopped = ep->stopped; | 2072 | int stopped = ep->stopped; |
@@ -2330,7 +2324,7 @@ static void handle_stat0_irqs (struct net2280 *dev, u32 stat) | |||
2330 | /* hw handles device and interface status */ | 2324 | /* hw handles device and interface status */ |
2331 | if (u.r.bRequestType != (USB_DIR_IN|USB_RECIP_ENDPOINT)) | 2325 | if (u.r.bRequestType != (USB_DIR_IN|USB_RECIP_ENDPOINT)) |
2332 | goto delegate; | 2326 | goto delegate; |
2333 | if ((e = get_ep_by_addr (dev, w_index)) == 0 | 2327 | if ((e = get_ep_by_addr (dev, w_index)) == NULL |
2334 | || w_length > 2) | 2328 | || w_length > 2) |
2335 | goto do_stall; | 2329 | goto do_stall; |
2336 | 2330 | ||
@@ -2358,7 +2352,7 @@ static void handle_stat0_irqs (struct net2280 *dev, u32 stat) | |||
2358 | if (w_value != USB_ENDPOINT_HALT | 2352 | if (w_value != USB_ENDPOINT_HALT |
2359 | || w_length != 0) | 2353 | || w_length != 0) |
2360 | goto do_stall; | 2354 | goto do_stall; |
2361 | if ((e = get_ep_by_addr (dev, w_index)) == 0) | 2355 | if ((e = get_ep_by_addr (dev, w_index)) == NULL) |
2362 | goto do_stall; | 2356 | goto do_stall; |
2363 | if (e->wedged) { | 2357 | if (e->wedged) { |
2364 | VDEBUG(dev, "%s wedged, halt not cleared\n", | 2358 | VDEBUG(dev, "%s wedged, halt not cleared\n", |
@@ -2380,7 +2374,7 @@ static void handle_stat0_irqs (struct net2280 *dev, u32 stat) | |||
2380 | if (w_value != USB_ENDPOINT_HALT | 2374 | if (w_value != USB_ENDPOINT_HALT |
2381 | || w_length != 0) | 2375 | || w_length != 0) |
2382 | goto do_stall; | 2376 | goto do_stall; |
2383 | if ((e = get_ep_by_addr (dev, w_index)) == 0) | 2377 | if ((e = get_ep_by_addr (dev, w_index)) == NULL) |
2384 | goto do_stall; | 2378 | goto do_stall; |
2385 | if (e->ep.name == ep0name) | 2379 | if (e->ep.name == ep0name) |
2386 | goto do_stall; | 2380 | goto do_stall; |
@@ -2685,7 +2679,6 @@ static void net2280_remove (struct pci_dev *pdev) | |||
2685 | pci_resource_len (pdev, 0)); | 2679 | pci_resource_len (pdev, 0)); |
2686 | if (dev->enabled) | 2680 | if (dev->enabled) |
2687 | pci_disable_device (pdev); | 2681 | pci_disable_device (pdev); |
2688 | device_unregister (&dev->gadget.dev); | ||
2689 | device_remove_file (&pdev->dev, &dev_attr_registers); | 2682 | device_remove_file (&pdev->dev, &dev_attr_registers); |
2690 | pci_set_drvdata (pdev, NULL); | 2683 | pci_set_drvdata (pdev, NULL); |
2691 | 2684 | ||
@@ -2717,10 +2710,6 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id) | |||
2717 | dev->gadget.max_speed = USB_SPEED_HIGH; | 2710 | dev->gadget.max_speed = USB_SPEED_HIGH; |
2718 | 2711 | ||
2719 | /* the "gadget" abstracts/virtualizes the controller */ | 2712 | /* the "gadget" abstracts/virtualizes the controller */ |
2720 | dev_set_name(&dev->gadget.dev, "gadget"); | ||
2721 | dev->gadget.dev.parent = &pdev->dev; | ||
2722 | dev->gadget.dev.dma_mask = pdev->dev.dma_mask; | ||
2723 | dev->gadget.dev.release = gadget_release; | ||
2724 | dev->gadget.name = driver_name; | 2713 | dev->gadget.name = driver_name; |
2725 | 2714 | ||
2726 | /* now all the pci goodies ... */ | 2715 | /* now all the pci goodies ... */ |
@@ -2802,7 +2791,6 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id) | |||
2802 | goto done; | 2791 | goto done; |
2803 | } | 2792 | } |
2804 | td->dmacount = 0; /* not VALID */ | 2793 | td->dmacount = 0; /* not VALID */ |
2805 | td->dmaaddr = cpu_to_le32 (DMA_ADDR_INVALID); | ||
2806 | td->dmadesc = td->dmaaddr; | 2794 | td->dmadesc = td->dmaaddr; |
2807 | dev->ep [i].dummy = td; | 2795 | dev->ep [i].dummy = td; |
2808 | } | 2796 | } |
@@ -2829,12 +2817,11 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id) | |||
2829 | use_dma | 2817 | use_dma |
2830 | ? (use_dma_chaining ? "chaining" : "enabled") | 2818 | ? (use_dma_chaining ? "chaining" : "enabled") |
2831 | : "disabled"); | 2819 | : "disabled"); |
2832 | retval = device_register (&dev->gadget.dev); | ||
2833 | if (retval) goto done; | ||
2834 | retval = device_create_file (&pdev->dev, &dev_attr_registers); | 2820 | retval = device_create_file (&pdev->dev, &dev_attr_registers); |
2835 | if (retval) goto done; | 2821 | if (retval) goto done; |
2836 | 2822 | ||
2837 | retval = usb_add_gadget_udc(&pdev->dev, &dev->gadget); | 2823 | retval = usb_add_gadget_udc_release(&pdev->dev, &dev->gadget, |
2824 | gadget_release); | ||
2838 | if (retval) | 2825 | if (retval) |
2839 | goto done; | 2826 | goto done; |
2840 | return 0; | 2827 | return 0; |