aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/pch_udc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 18:50:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 18:50:46 -0400
commita481991467d38afb43c3921d5b5b59ccb61b04ba (patch)
treea4b0b9a14da6fd5ef7b9b512bb32dbfcfcf2cd71 /drivers/usb/gadget/pch_udc.c
parentf6a26ae7699416d86bea8cb68ce413571e9cab3c (diff)
parentcda4db53e9c28061c100400e1a4d273ea61dfba9 (diff)
Merge tag 'usb-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB 3.5-rc1 changes from Greg Kroah-Hartman: "Here is the big USB 3.5-rc1 pull request for the 3.5-rc1 merge window. It's touches a lot of different parts of the kernel, all USB drivers, due to some API cleanups (getting rid of the ancient err() macro) and some changes that are needed for USB 3.0 power management updates. There are also lots of new drivers, pimarily gadget, but others as well. We deleted a staging driver, which was nice, and finally dropped the obsolete usbfs code, which will make Al happy to never have to touch that again. There were some build errors in the tree that linux-next found a few days ago, but those were fixed by the most recent changes (all were due to us not building with CONFIG_PM disabled.) Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'usb-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (477 commits) xhci: Fix DIV_ROUND_UP compile error. xhci: Fix compile with CONFIG_USB_SUSPEND=n USB: Fix core compile with CONFIG_USB_SUSPEND=n brcm80211: Fix compile error for .disable_hub_initiated_lpm. Revert "USB: EHCI: work around bug in the Philips ISP1562 controller" MAINTAINERS: Add myself as maintainer to the USB PHY Layer USB: EHCI: fix command register configuration lost problem USB: Remove races in devio.c USB: ehci-platform: remove update_device USB: Disable hub-initiated LPM for comms devices. xhci: Add Intel U1/U2 timeout policy. xhci: Add infrastructure for host-specific LPM policies. USB: Add macros for interrupt endpoint types. xhci: Reserve one command for USB3 LPM disable. xhci: Some Evaluate Context commands must succeed. USB: Disable USB 3.0 LPM in critical sections. USB: Add support to enable/disable USB3 link states. USB: Allow drivers to disable hub-initiated LPM. USB: Calculate USB 3.0 exit latencies for LPM. USB: Refactor code to set LPM support flag. ... Conflicts: arch/arm/mach-exynos/mach-nuri.c arch/arm/mach-exynos/mach-universal_c210.c drivers/net/wireless/ath/ath6kl/usb.c
Diffstat (limited to 'drivers/usb/gadget/pch_udc.c')
-rw-r--r--drivers/usb/gadget/pch_udc.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c
index 65307064a6f..1cfcc9ecbfb 100644
--- a/drivers/usb/gadget/pch_udc.c
+++ b/drivers/usb/gadget/pch_udc.c
@@ -295,7 +295,6 @@ struct pch_udc_ep {
295 struct pch_udc_data_dma_desc *td_data; 295 struct pch_udc_data_dma_desc *td_data;
296 struct pch_udc_dev *dev; 296 struct pch_udc_dev *dev;
297 unsigned long offset_addr; 297 unsigned long offset_addr;
298 const struct usb_endpoint_descriptor *desc;
299 struct list_head queue; 298 struct list_head queue;
300 unsigned num:5, 299 unsigned num:5,
301 in:1, 300 in:1,
@@ -1705,7 +1704,7 @@ static int pch_udc_pcd_ep_enable(struct usb_ep *usbep,
1705 if (!dev->driver || (dev->gadget.speed == USB_SPEED_UNKNOWN)) 1704 if (!dev->driver || (dev->gadget.speed == USB_SPEED_UNKNOWN))
1706 return -ESHUTDOWN; 1705 return -ESHUTDOWN;
1707 spin_lock_irqsave(&dev->lock, iflags); 1706 spin_lock_irqsave(&dev->lock, iflags);
1708 ep->desc = desc; 1707 ep->ep.desc = desc;
1709 ep->halted = 0; 1708 ep->halted = 0;
1710 pch_udc_ep_enable(ep, &ep->dev->cfg_data, desc); 1709 pch_udc_ep_enable(ep, &ep->dev->cfg_data, desc);
1711 ep->ep.maxpacket = usb_endpoint_maxp(desc); 1710 ep->ep.maxpacket = usb_endpoint_maxp(desc);
@@ -1734,7 +1733,7 @@ static int pch_udc_pcd_ep_disable(struct usb_ep *usbep)
1734 1733
1735 ep = container_of(usbep, struct pch_udc_ep, ep); 1734 ep = container_of(usbep, struct pch_udc_ep, ep);
1736 dev = ep->dev; 1735 dev = ep->dev;
1737 if ((usbep->name == ep0_string) || !ep->desc) 1736 if ((usbep->name == ep0_string) || !ep->ep.desc)
1738 return -EINVAL; 1737 return -EINVAL;
1739 1738
1740 spin_lock_irqsave(&ep->dev->lock, iflags); 1739 spin_lock_irqsave(&ep->dev->lock, iflags);
@@ -1742,7 +1741,6 @@ static int pch_udc_pcd_ep_disable(struct usb_ep *usbep)
1742 ep->halted = 1; 1741 ep->halted = 1;
1743 pch_udc_ep_disable(ep); 1742 pch_udc_ep_disable(ep);
1744 pch_udc_disable_ep_interrupts(ep->dev, PCH_UDC_EPINT(ep->in, ep->num)); 1743 pch_udc_disable_ep_interrupts(ep->dev, PCH_UDC_EPINT(ep->in, ep->num));
1745 ep->desc = NULL;
1746 ep->ep.desc = NULL; 1744 ep->ep.desc = NULL;
1747 INIT_LIST_HEAD(&ep->queue); 1745 INIT_LIST_HEAD(&ep->queue);
1748 spin_unlock_irqrestore(&ep->dev->lock, iflags); 1746 spin_unlock_irqrestore(&ep->dev->lock, iflags);
@@ -1849,7 +1847,7 @@ static int pch_udc_pcd_queue(struct usb_ep *usbep, struct usb_request *usbreq,
1849 return -EINVAL; 1847 return -EINVAL;
1850 ep = container_of(usbep, struct pch_udc_ep, ep); 1848 ep = container_of(usbep, struct pch_udc_ep, ep);
1851 dev = ep->dev; 1849 dev = ep->dev;
1852 if (!ep->desc && ep->num) 1850 if (!ep->ep.desc && ep->num)
1853 return -EINVAL; 1851 return -EINVAL;
1854 req = container_of(usbreq, struct pch_udc_request, req); 1852 req = container_of(usbreq, struct pch_udc_request, req);
1855 if (!list_empty(&req->queue)) 1853 if (!list_empty(&req->queue))
@@ -1949,7 +1947,7 @@ static int pch_udc_pcd_dequeue(struct usb_ep *usbep,
1949 1947
1950 ep = container_of(usbep, struct pch_udc_ep, ep); 1948 ep = container_of(usbep, struct pch_udc_ep, ep);
1951 dev = ep->dev; 1949 dev = ep->dev;
1952 if (!usbep || !usbreq || (!ep->desc && ep->num)) 1950 if (!usbep || !usbreq || (!ep->ep.desc && ep->num))
1953 return ret; 1951 return ret;
1954 req = container_of(usbreq, struct pch_udc_request, req); 1952 req = container_of(usbreq, struct pch_udc_request, req);
1955 spin_lock_irqsave(&ep->dev->lock, flags); 1953 spin_lock_irqsave(&ep->dev->lock, flags);
@@ -1988,7 +1986,7 @@ static int pch_udc_pcd_set_halt(struct usb_ep *usbep, int halt)
1988 return -EINVAL; 1986 return -EINVAL;
1989 ep = container_of(usbep, struct pch_udc_ep, ep); 1987 ep = container_of(usbep, struct pch_udc_ep, ep);
1990 dev = ep->dev; 1988 dev = ep->dev;
1991 if (!ep->desc && !ep->num) 1989 if (!ep->ep.desc && !ep->num)
1992 return -EINVAL; 1990 return -EINVAL;
1993 if (!ep->dev->driver || (ep->dev->gadget.speed == USB_SPEED_UNKNOWN)) 1991 if (!ep->dev->driver || (ep->dev->gadget.speed == USB_SPEED_UNKNOWN))
1994 return -ESHUTDOWN; 1992 return -ESHUTDOWN;
@@ -2033,7 +2031,7 @@ static int pch_udc_pcd_set_wedge(struct usb_ep *usbep)
2033 return -EINVAL; 2031 return -EINVAL;
2034 ep = container_of(usbep, struct pch_udc_ep, ep); 2032 ep = container_of(usbep, struct pch_udc_ep, ep);
2035 dev = ep->dev; 2033 dev = ep->dev;
2036 if (!ep->desc && !ep->num) 2034 if (!ep->ep.desc && !ep->num)
2037 return -EINVAL; 2035 return -EINVAL;
2038 if (!ep->dev->driver || (ep->dev->gadget.speed == USB_SPEED_UNKNOWN)) 2036 if (!ep->dev->driver || (ep->dev->gadget.speed == USB_SPEED_UNKNOWN))
2039 return -ESHUTDOWN; 2037 return -ESHUTDOWN;
@@ -2065,7 +2063,7 @@ static void pch_udc_pcd_fifo_flush(struct usb_ep *usbep)
2065 return; 2063 return;
2066 2064
2067 ep = container_of(usbep, struct pch_udc_ep, ep); 2065 ep = container_of(usbep, struct pch_udc_ep, ep);
2068 if (ep->desc || !ep->num) 2066 if (ep->ep.desc || !ep->num)
2069 pch_udc_ep_fifo_flush(ep, ep->in); 2067 pch_udc_ep_fifo_flush(ep, ep->in);
2070} 2068}
2071 2069
@@ -3282,7 +3280,6 @@ static DEFINE_PCI_DEVICE_TABLE(pch_udc_pcidev_id) = {
3282 3280
3283MODULE_DEVICE_TABLE(pci, pch_udc_pcidev_id); 3281MODULE_DEVICE_TABLE(pci, pch_udc_pcidev_id);
3284 3282
3285
3286static struct pci_driver pch_udc_driver = { 3283static struct pci_driver pch_udc_driver = {
3287 .name = KBUILD_MODNAME, 3284 .name = KBUILD_MODNAME,
3288 .id_table = pch_udc_pcidev_id, 3285 .id_table = pch_udc_pcidev_id,
@@ -3293,17 +3290,7 @@ static struct pci_driver pch_udc_driver = {
3293 .shutdown = pch_udc_shutdown, 3290 .shutdown = pch_udc_shutdown,
3294}; 3291};
3295 3292
3296static int __init pch_udc_pci_init(void) 3293module_pci_driver(pch_udc_driver);
3297{
3298 return pci_register_driver(&pch_udc_driver);
3299}
3300module_init(pch_udc_pci_init);
3301
3302static void __exit pch_udc_pci_exit(void)
3303{
3304 pci_unregister_driver(&pch_udc_driver);
3305}
3306module_exit(pch_udc_pci_exit);
3307 3294
3308MODULE_DESCRIPTION("Intel EG20T USB Device Controller"); 3295MODULE_DESCRIPTION("Intel EG20T USB Device Controller");
3309MODULE_AUTHOR("LAPIS Semiconductor, <tomoya-linux@dsn.lapis-semi.com>"); 3296MODULE_AUTHOR("LAPIS Semiconductor, <tomoya-linux@dsn.lapis-semi.com>");